diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-09-17 13:53:59 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 13:53:59 -0700 |
| commit | 1c515bf7e2b395509a122fb92cd6f925bf09a6fe (patch) | |
| tree | 8e4410c4163d6d8c985f7aef742efab8cb563ef6 /Documentation | |
| parent | 2af0b1c6007401086bd72d4f49fbd5e9462f37f4 (diff) | |
| parent | 684e742249b48ec0c5491a98fa3b1427793738ce (diff) | |
| download | git-1c515bf7e2b395509a122fb92cd6f925bf09a6fe.tar.xz | |
Merge branch 'es/worktree-forced-ops-fix'
Fix a bug in which the same path could be registered under multiple
worktree entries if the path was missing (for instance, was removed
manually). Also, as a convenience, expand the number of cases in
which --force is applicable.
* es/worktree-forced-ops-fix:
doc-diff: force worktree add
worktree: delete .git/worktrees if empty after 'remove'
worktree: teach 'remove' to override lock when --force given twice
worktree: teach 'move' to override lock when --force given twice
worktree: teach 'add' to respect --force for registered but missing path
worktree: disallow adding same path multiple times
worktree: prepare for more checks of whether path can become worktree
worktree: generalize delete_git_dir() to reduce code duplication
worktree: move delete_git_dir() earlier in file for upcoming new callers
worktree: don't die() in library function find_worktree()
Diffstat (limited to 'Documentation')
| -rwxr-xr-x | Documentation/doc-diff | 2 | ||||
| -rw-r--r-- | Documentation/git-worktree.txt | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/doc-diff b/Documentation/doc-diff index cece4fd537..dfd9418778 100755 --- a/Documentation/doc-diff +++ b/Documentation/doc-diff @@ -75,7 +75,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 diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 29a5b7e252..e2ee9fc21b 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -120,8 +120,16 @@ OPTIONS --force:: By default, `add` refuses to create a new working tree when `<commit-ish>` is a branch name and is already checked out by - another working tree and `remove` refuses to remove an unclean - working tree. This option overrides these safeguards. + another working tree, or if `<path>` is already assigned to some + working tree but is missing (for instance, if `<path>` was deleted + manually). This option overrides these safeguards. To add a missing but + locked working tree path, specify `--force` twice. ++ +`move` refuses to move a locked working tree unless `--force` is specified +twice. ++ +`remove` refuses to remove an unclean working tree unless `--force` is used. +To remove a locked working tree, specify `--force` twice. -b <new-branch>:: -B <new-branch>:: |
