From dffb03a0f324ea4e665c205e269eb8d910148c03 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 24 Feb 2025 17:08:32 -0600 Subject: [PATCH] Create a `.git` directory in the test context root --- crates/uv/tests/it/common/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/uv/tests/it/common/mod.rs b/crates/uv/tests/it/common/mod.rs index 36f0141cd0fb..6b1a255619df 100644 --- a/crates/uv/tests/it/common/mod.rs +++ b/crates/uv/tests/it/common/mod.rs @@ -332,6 +332,11 @@ impl TestContext { let root = tempfile::TempDir::new_in(bucket).expect("Failed to create test root directory"); + // Create a `.git` directory to isolate tests that search for git boundaries from the state + // of the file system + fs_err::create_dir_all(root.path().join(".git")) + .expect("Failed to create `.git` placeholder in test root directory"); + let temp_dir = ChildPath::new(root.path()).child("temp"); fs_err::create_dir_all(&temp_dir).expect("Failed to create test working directory");