mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-10-06 00:02:14 +00:00
test(git): pin status.showUntrackedFiles in the tests' scratch repositories (#1091)
Five tty7-core tests and two tty7-server conformance checks failed on a machine with a global `status.showUntrackedFiles=no`: git hid the files they had just written. PINS (and so pin_repo_config) now carries `status.showUntrackedFiles=normal`, the worktree tests' temp_repo pins its repository, and the host conformance suite's git_repo sets the key itself, since other crates run it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e60bf9f12c
commit
b65a3e4efc
@@ -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 `<repo>/.git/config`.
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user