Skip to content

Commit 831d1b8

Browse files
committed
update HEAD
1 parent 60b7f84 commit 831d1b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/integration/git.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,21 @@ const makeFileChanges = async (
233233
});
234234
console.log("[DEBUG makeFileChanges] Commit created:", commitResult);
235235

236+
// In detached HEAD state, isomorphic-git doesn't update HEAD after commit.
237+
// Use writeRef to update HEAD to point to the new commit.
238+
await git.writeRef({
239+
fs,
240+
dir: repoDirectory,
241+
ref: "HEAD",
242+
value: commitResult,
243+
force: true,
244+
});
245+
246+
console.log(
247+
"[DEBUG makeFileChanges] Updated HEAD via writeRef to:",
248+
commitResult,
249+
);
250+
236251
// Verify HEAD was updated
237252
const headAfterCommit = await git.resolveRef({
238253
fs,

0 commit comments

Comments
 (0)