summaryrefslogtreecommitdiff
path: root/t/t2025-worktree-add.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2015-07-06 13:30:58 -0400
committerJunio C Hamano <gitster@pobox.com>2015-07-06 11:07:48 -0700
commit0f4af3b9ea1fc62e445271bb2e7fbb8e1ac230b7 (patch)
tree0980a1eeee8eababf711fc6b2e1dc0133bc0adac /t/t2025-worktree-add.sh
parentf5682b2a861cbde6e9aca324caa5e2d36c49569a (diff)
downloadgit-0f4af3b9ea1fc62e445271bb2e7fbb8e1ac230b7.tar.gz
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>
Diffstat (limited to 't/t2025-worktree-add.sh')
-rwxr-xr-xt/t2025-worktree-add.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index 192c936735..8964dec75a 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -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