fix: make git integration test self-contained for CI
The 'fetch+reset path' test called commitAndPush without author args and relied on an ambient git identity. A bare CI runner has none, so 'git commit' failed with 'Author identity unknown'. Pass an explicit author like the sibling tests so the suite is deterministic regardless of runner git config. Co-Authored-By: Claude
This commit is contained in:
@@ -45,7 +45,9 @@ test("second sync resets cleanly (fetch+reset path)", async () => {
|
||||
const client = new ChildProcessGitClient({ baseDir: base });
|
||||
await client.syncClone({ url: bare, branch: "main" });
|
||||
await client.writeFiles([{ repoPath: "_posts/second.md", data: "x" }]);
|
||||
await client.commitAndPush({ message: "second", branch: "main" });
|
||||
// Pass an explicit author so the test does not depend on an ambient git
|
||||
// identity (a bare CI runner has none and `git commit` would fail).
|
||||
await client.commitAndPush({ message: "second", branch: "main", authorName: "t", authorEmail: "t@t" });
|
||||
const verify = join(root, "verify2");
|
||||
execFileSync("git", ["clone", bare, verify]);
|
||||
expect(readFileSync(join(verify, "_posts/second.md"), "utf8")).toBe("x");
|
||||
|
||||
Reference in New Issue
Block a user