Skip to content

Commit

Permalink
fix: Use --force instead of -f for worktree remove command
Browse files Browse the repository at this point in the history
Using the `-f` fails with the following error on a Linux Mint. Using `--force` works as expected.

```
error: unknown switch `f'
usage: git worktree add [<options>] <path> [<commit-ish>]
   or: git worktree list [<options>]
   or: git worktree lock [<options>] <path>
   or: git worktree move <worktree> <new-path>
   or: git worktree prune [<options>]
   or: git worktree remove [<options>] <worktree>
   or: git worktree unlock <path>

    --force               force removing even if the worktree is dirty
```
  • Loading branch information
starikcetin authored and mob-sakai committed Sep 4, 2020
1 parent e673da8 commit 6685967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function gitSnapshot(argv) {
} finally {
// Remove added worktree.
if (isAddedWorktree) {
await git(['worktree', 'remove', '-f', worktreePath], onCwdOpts);
await git(['worktree', 'remove', '--force', worktreePath], onCwdOpts);
await git(['worktree', 'prune'], onCwdOpts);
}

Expand Down

0 comments on commit 6685967

Please sign in to comment.