git-ents.gitmain
⌘K
foforge
commit f2e74ef
fix: set a git identity in web-edit test commits so CI runners pass

The add_member test helper runs git commit-tree, which needs a committer identity. CI runners have no global git config, so the call failed and three web-edit tests panicked on Linux, musllinux, and Windows. Pass GIT_AUTHOR_*/GIT_COMMITTER_* env vars to the test git helper.

test: pass author/committer identity to the web-edit git helper Assisted-by: Claude:claude-opus-4-8

Joseph D. Carpinelli · 1 month ago

Reviews

No reviews of this commit yet — record a verdict below.

Start a review

verdict

crates/git-ents-server/tests/web_edit.rs @@ -477,6 +477,7 @@ .arg("-C") .arg(bare) .args(args) + .envs(identity()) .stdin(Stdio::null()) .output() .unwrap(); @@ -486,6 +487,15 @@ .then(|| String::from_utf8_lossy(&output.stdout).trim().to_owned()) } +fn identity() -> [(&'static str, &'static str); 4] { + [ + ("GIT_AUTHOR_NAME", "test"), + ("GIT_AUTHOR_EMAIL", "test@example.com"), + ("GIT_COMMITTER_NAME", "test"), + ("GIT_COMMITTER_EMAIL", "test@example.com"), + ] +} + fn hash_object(bare: &Path, bytes: &[u8]) -> String { pipe(bare, &["hash-object", "-w", "--stdin"], bytes) }