Re: [PATCH v3 14/22] worktree: add: suppress auto-vivication with --detach and no <branch>
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 17, 2015, 23:20 UTC
- Message-ID
- <20150717232040.GA85140@flurp.local>
- In-Reply-To
- <1437174017-81687-15-git-send-email-sunshine@sunshineco.com>
On Fri, Jul 17, 2015 at 07:00:09PM -0400, Eric Sunshine wrote:
Show 14 quoted lines
> 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> > --- > builtin/worktree.c | 2 +- > t/t2025-worktree-add.sh | 14 ++++++++++++++ > 2 files changed, 15 insertions(+), 1 deletion(-)
I meant, but forgot, to include a documentation update with this patch. Here it is as a squash-in:
---- 8< ---- From: Eric Sunshine <sunshine@sunshineco.com> Subject: [PATCH v3 23/22] fixup! worktree: add: suppress auto-vivication with --detach and no <branch>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> --- Documentation/git-worktree.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index da71f50..834a61c 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::
-- 2.5.0.rc2.378.g0af52e8