diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2015-07-18 01:00:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-20 20:29:51 +0200 |
commit | 5c942570fe2a48d8fde348e89392c2e9e23aa483 (patch) | |
tree | 1be8561173a8f4d7f33066ee3158f1549b8b968e /Documentation | |
parent | worktree: make --detach mutually exclusive with -b/-B (diff) | |
download | git-5c942570fe2a48d8fde348e89392c2e9e23aa483.tar.xz git-5c942570fe2a48d8fde348e89392c2e9e23aa483.zip |
worktree: add: suppress auto-vivication with --detach and no <branch>
Fix oversight where branch auto-vivication incorrectly kicks in when
--detach is specified and <branch> omitted. Instead, treat:
git worktree add --detach <path>
as shorthand for:
git worktree add --detach <path> HEAD
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-worktree.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 32344598c3..332dd7734d 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -51,9 +51,9 @@ Create `<path>` and checkout `<branch>` into it. The new working directory is linked to the current repository, sharing everything except working directory specific files such as HEAD, index, etc. + -If `<branch>` is omitted and neither `-b` nor `-B` is used, then, as a -convenience, a new branch based at HEAD is created automatically, as if -`-b $(basename <path>)` was specified. +If `<branch>` is omitted and neither `-b` nor `-B` nor `--detached` used, +then, as a convenience, a new branch based at HEAD is created automatically, +as if `-b $(basename <path>)` was specified. prune:: |