From 668596762f3732bba68b3bdd3ceda0ad52dd6eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=20Tar=C4=B1k=20=C3=87etin?= Date: Fri, 4 Sep 2020 22:47:07 +0300 Subject: [PATCH] fix: Use `--force` instead of `-f` for worktree remove command 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 [] [] or: git worktree list [] or: git worktree lock [] or: git worktree move or: git worktree prune [] or: git worktree remove [] or: git worktree unlock --force force removing even if the worktree is dirty ``` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7f9d4cc..86bd108 100644 --- a/index.js +++ b/index.js @@ -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); }