Skip to content

Commit b135b0a

Browse files
committed
Use --force when deleting worktrees
This is required for deleting worktrees with submodules. It also protects against deleting worktrees with uncommited changes, but we already added a check to avoid that situation.
1 parent 40d0b45 commit b135b0a

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

app/src/lib/git/worktree.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,9 @@ export async function addWorktree(
101101

102102
export async function removeWorktree(
103103
repository: Repository,
104-
path: string,
105-
force: boolean = false
104+
path: string
106105
): Promise<void> {
107-
const args = ['worktree', 'remove']
108-
if (force) {
109-
args.push('--force')
110-
}
111-
args.push(path)
112-
106+
const args = ['worktree', 'remove', '--force', path]
113107
await git(args, repository.path, 'removeWorktree')
114108
}
115109

0 commit comments

Comments
 (0)