Skip to content

Commit a9d635f

Browse files
committed
fix(test): set git identity on the artifact test clone
clone_to_b() cloned the source repo but never configured user.email or user.name on the result. A clone does not inherit the source repo's LOCAL config, and CI runners have no global identity, so every commit made in the clone exited 128 -- surfacing as: FAIL tests/test_artifact.c:734: runf("git -C ... add -A && git -C ... commit -qm edits") == 32768, expected 0 32768 is 128 << 8. It passed locally only because developer machines carry a global git identity; the Linux CI shards do not. git_init() already configures identity for the source repo (:574-575); the clone needs the same treatment. This is the defect originally diagnosed on DeusData#868 as "git identity in clone_to_b" -- correct for the POSIX legs, and separate from the cmd.exe quoting bug that caused the Windows failure. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 6140094 commit a9d635f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎tests/test_artifact.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,14 @@ static bool clone_to_b(char *repoB_out, size_t repoB_sz) {
677677
snprintf(work, sizeof(work), "%s/work", g_tmpdir);
678678
cbm_mkdir_p(work, 0755);
679679
snprintf(repoB_out, repoB_sz, "%s/repo", work);
680-
return runf("git clone -q \"%s\" \"%s\"", g_repo, repoB_out) == 0;
680+
if (runf("git clone -q \"%s\" \"%s\"", g_repo, repoB_out) != 0) {
681+
return false;
682+
}
683+
/* A clone does NOT inherit the source repo's local user config, and CI
684+
* runners have no global identity -- `git commit` then exits 128. Set it
685+
* on the clone the same way git_init() does for the source repo. */
686+
return runf("git -C \"%s\" config user.email t@t.com", repoB_out) == 0 &&
687+
runf("git -C \"%s\" config user.name t", repoB_out) == 0;
681688
}
682689

683690
TEST(artifact_export_marks_clean_basis) {

0 commit comments

Comments
 (0)