doc-diff: force worktree add
We avoid re-creating our temporary worktree if it's already there. But we may run into a situation where the worktree has been deleted, but an entry still exists in $GIT_DIR/worktrees. Older versions of git-worktree would annoyingly create a series of duplicate entries. Recent versions now detect and prevent this, allowing you to override with "-f". Since we know that the worktree in question was just our temporary workspace, it's safe for us to always pass "-f". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Aug 30, 2018 at 03:54 UTC
684e742249b48ec0c5491a98fa3b1427793738ce
1 file changed
+1
-1
Documentation/doc-diff
+1
-1
@@ -54,7 +54,7 @@ fi
54
# results that don't differ between the two trees.
55
if ! test -d "$tmp/worktree"
56
then
57
- git worktree add --detach "$tmp/worktree" "$from" &&
57
+ git worktree add -f --detach "$tmp/worktree" "$from" &&
58
dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
59
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
60
fi