File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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" ) ) ;
You can’t perform that action at this time.
0 commit comments