diff --git a/crates/tty7-core/src/core/git/mod.rs b/crates/tty7-core/src/core/git/mod.rs index 7371c85a..424842d6 100644 --- a/crates/tty7-core/src/core/git/mod.rs +++ b/crates/tty7-core/src/core/git/mod.rs @@ -481,8 +481,9 @@ pub(crate) mod test_support { /// have signing on globally. The two line-ending settings are here for the /// same reason: Git for Windows ships `core.autocrlf=true` in its *system* /// config, so a fixture built with LF and read back is a fixture whose - /// bytes depend on which machine ran the test. - pub(crate) const PINS: [&str; 10] = [ + /// bytes depend on which machine ran the test. A developer's + /// `status.showUntrackedFiles=no` would hide the files a test just wrote. + pub(crate) const PINS: [&str; 12] = [ "-c", "user.name=tty7 test", "-c", @@ -493,6 +494,8 @@ pub(crate) mod test_support { "core.autocrlf=false", "-c", "core.eol=lf", + "-c", + "status.showUntrackedFiles=normal", ]; /// The same settings, written into `/.git/config`. diff --git a/crates/tty7-core/src/core/worktree/mod.rs b/crates/tty7-core/src/core/worktree/mod.rs index dddf21bc..2017f910 100644 --- a/crates/tty7-core/src/core/worktree/mod.rs +++ b/crates/tty7-core/src/core/worktree/mod.rs @@ -452,8 +452,7 @@ mod tests { fn temp_repo(name: &str) -> PathBuf { let dir = scratch(name); sh(&dir, &["git", "init", "-q"]); - sh(&dir, &["git", "config", "user.email", "t@t"]); - sh(&dir, &["git", "config", "user.name", "t"]); + assert!(crate::core::git::test_support::pin_repo_config(&dir)); std::fs::write(dir.join("a.txt"), "a").unwrap(); sh(&dir, &["git", "add", "."]); sh(&dir, &["git", "commit", "-q", "-m", "init"]); diff --git a/crates/tty7-core/src/host/conformance.rs b/crates/tty7-core/src/host/conformance.rs index e8bb8647..9d51acaa 100644 --- a/crates/tty7-core/src/host/conformance.rs +++ b/crates/tty7-core/src/host/conformance.rs @@ -152,6 +152,12 @@ fn hit_names(hits: &[SearchHit]) -> Vec<&str> { fn git_repo(h: &dyn Host, dir: &Path) -> Option<()> { let out = h.git(dir, &["init", "--quiet"]).ok()?; + out.success().then_some(())?; + // A developer's `status.showUntrackedFiles=no` would hide the files a + // check just wrote. + let out = h + .git(dir, &["config", "status.showUntrackedFiles", "normal"]) + .ok()?; out.success().then_some(()) }