diff options
author | Jeff King <peff@peff.net> | 2018-08-30 10:54:31 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-05 20:47:21 +0300 |
commit | 684e742249b48ec0c5491a98fa3b1427793738ce (patch) | |
tree | 112cc2f49172c8084561a7c9a28cfd2906db4342 /Documentation/doc-diff | |
parent | 3a5404333c6c8b5897e78c9dcb711d623035791b (diff) |
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>
Diffstat (limited to 'Documentation/doc-diff')
-rwxr-xr-x | Documentation/doc-diff | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/doc-diff b/Documentation/doc-diff index f483fe427c..19d841ddeb 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -54,7 +54,7 @@ fi # results that don't differ between the two trees. if ! test -d "$tmp/worktree" then - git worktree add --detach "$tmp/worktree" "$from" && + git worktree add -f --detach "$tmp/worktree" "$from" && dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') && ln -s "$dots/config.mak" "$tmp/worktree/config.mak" fi |