diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-26 13:14:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-26 13:14:45 -0700 |
commit | 8e83d0531579da7abbfc603b5268995c2464efe8 (patch) | |
tree | 243be5479322bdf43bbf1ee96c311991dca7bee6 /t | |
parent | 56d268bafff7538f82c01d3c9c07bdc54b2993b1 (diff) | |
parent | 171c646f8c6484cca76933ebe8a6af52df47277d (diff) | |
download | git-8e83d0531579da7abbfc603b5268995c2464efe8.tar.gz git-8e83d0531579da7abbfc603b5268995c2464efe8.tar.xz |
Merge branch 'dk/worktree-dup-checkout-with-bare-is-ok'
In a worktree connected to a repository elsewhere, created via "git
worktree", "git checkout" attempts to protect users from confusion
by refusing to check out a branch that is already checked out in
another worktree. However, this also prevented checking out a
branch, which is designated as the primary branch of a bare
reopsitory, in a worktree that is connected to the bare
repository. The check has been corrected to allow it.
* dk/worktree-dup-checkout-with-bare-is-ok:
worktree: allow the main brach of a bare repository to be checked out
Diffstat (limited to 't')
-rwxr-xr-x | t/t2025-worktree-add.sh | 8 |
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 && |