worktree: add: make -b/-B default to HEAD when <branch> is omitted
As a convenience, like "git branch" and "git checkout -b", make "git worktree add -b <newbranch> <path> <branch>" default to HEAD when <branch> is omitted. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f5682b2a86
commit
0f4af3b9ea
@ -140,4 +140,9 @@ test_expect_success '"add" from relative HEAD' '
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success '"add -b" with <branch> omitted' '
|
||||
git worktree add -b burble flornk &&
|
||||
test_cmp_rev HEAD burble
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user