Skip to content

Commit 684e742

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3a54043 commit 684e742

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/doc-diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454
# results that don't differ between the two trees.
5555
if ! test -d "$tmp/worktree"
5656
then
57-
git worktree add --detach "$tmp/worktree" "$from" &&
57+
git worktree add -f --detach "$tmp/worktree" "$from" &&
5858
dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
5959
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
6060
fi

0 commit comments

Comments
 (0)