mirror of
https://github.com/git/git.git
synced 2024-12-11 10:54:21 +08:00
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>
This commit is contained in:
parent
3a5404333c
commit
684e742249
@ -54,7 +54,7 @@ fi
|
|||||||
# results that don't differ between the two trees.
|
# results that don't differ between the two trees.
|
||||||
if ! test -d "$tmp/worktree"
|
if ! test -d "$tmp/worktree"
|
||||||
then
|
then
|
||||||
git worktree add --detach "$tmp/worktree" "$from" &&
|
git worktree add -f --detach "$tmp/worktree" "$from" &&
|
||||||
dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
|
dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
|
||||||
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
|
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user