aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDennis Kaarsemaker <dennis@kaarsemaker.net>2016-10-12 18:41:07 +0200
committerJunio C Hamano <gitster@pobox.com>2016-10-14 09:58:58 -0700
commit171c646f8c6484cca76933ebe8a6af52df47277d (patch)
treedd23cd499840e8d6078295712da32a97e3344562 /t
parent74eeaf7b72a94bd3e0ff275edb90e6ee2423b529 (diff)
downloadgit-171c646f8c6484cca76933ebe8a6af52df47277d.tar.gz
git-171c646f8c6484cca76933ebe8a6af52df47277d.tar.xz
worktree: allow the main brach of a bare repository to be checked out
In bare repositories, get_worktrees() still returns the main repository, so git worktree list can show it. ignore it in find_shared_symref so we can still check out the main branch. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t2025-worktree-add.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index 4bcc335a1..b618d6be2 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -138,6 +138,14 @@ test_expect_success 'checkout from a bare repo without "add"' '
)
'
+test_expect_success '"add" default branch of a bare repo' '
+ (
+ git clone --bare . bare2 &&
+ cd bare2 &&
+ git worktree add ../there3 master
+ )
+'
+
test_expect_success 'checkout with grafts' '
test_when_finished rm .git/info/grafts &&
test_commit abc &&