summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-01-24 17:14:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-01-24 17:14:46 (GMT)
commitc6e19e47a60c0174f805db8e1624db38ff889523 (patch)
tree5528f62eb204380d4586f83653d0382c640c0c2b /t
parent7ea759cf9b8a4789e6fb3d12b618b3b9a005765a (diff)
parent519947b69a9ea1461d5f5afc762823835295b3b2 (diff)
downloadgit-c6e19e47a60c0174f805db8e1624db38ff889523.zip
git-c6e19e47a60c0174f805db8e1624db38ff889523.tar.gz
git-c6e19e47a60c0174f805db8e1624db38ff889523.tar.bz2
Merge branch 'ab/checkout-branch-info-leakfix'
We added an unrelated sanity checking that leads to a BUG() while plugging a leak, which triggered in a repository with symrefs in the local branch namespace that point at a ref outside. Partially revert the change to avoid triggering the BUG(). * ab/checkout-branch-info-leakfix: checkout: avoid BUG() when hitting a broken repository
Diffstat (limited to 't')
-rwxr-xr-xt/t2018-checkout-branch.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh
index 3e93506..52e51b0 100755
--- a/t/t2018-checkout-branch.sh
+++ b/t/t2018-checkout-branch.sh
@@ -85,6 +85,19 @@ test_expect_success 'setup' '
git branch -m branch1
'
+test_expect_success 'checkout a branch without refs/heads/* prefix' '
+ git clone --no-tags . repo-odd-prefix &&
+ (
+ cd repo-odd-prefix &&
+
+ origin=$(git symbolic-ref refs/remotes/origin/HEAD) &&
+ git symbolic-ref refs/heads/a-branch "$origin" &&
+
+ git checkout -f a-branch &&
+ git checkout -f a-branch
+ )
+'
+
test_expect_success 'checkout -b to a new branch, set to HEAD' '
test_when_finished "
git checkout branch1 &&