Commit d55594d
authored
fix: process.chdir to main worktree before removing current worktree on sync (#39)
fix: process.chdir to main worktree before removing current worktree
When morg sync deletes the current branch's worktree, the process cwd
becomes a deleted directory. All subsequent git calls (deleteBranch,
getCurrentBranch in Step 4) then fail because git can't find the repo.
Fix: call process.chdir(mainRoot) before removeWorktree so the process
stays in a valid git directory for the rest of the sync run.1 parent ad75e59 commit d55594d
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
0 commit comments