Skip to content

Commit 113aa27

Browse files
committed
update HEAD
1 parent af4c42d commit 113aa27

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/integration/git.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,21 @@ const makeFileChanges = async (
198198
dir: repoDirectory,
199199
filepath: "some-dir/nested",
200200
});
201-
await git.commit({
201+
const newCommit = await git.commit({
202202
fs,
203203
dir: repoDirectory,
204204
message: "Add symlink",
205205
author: { name: "Test", email: "test@test.com" },
206206
});
207+
// In detached HEAD state, isomorphic-git doesn't update HEAD after commit.
208+
// Use writeRef to update HEAD to point to the new commit.
209+
await git.writeRef({
210+
fs,
211+
dir: repoDirectory,
212+
ref: "HEAD",
213+
value: newCommit,
214+
force: true,
215+
});
207216

208217
if (changegroup === "with-changed-symlink") {
209218
await fs.promises.rm(path.join(repoDirectory, "some-dir", "nested"));

0 commit comments

Comments
 (0)