Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-10-21 21:37:28 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-21 21:37:28 +0300
commit4a48c7d25f941532befaf3320f95f16d3c62b530 (patch)
tree8c693852b1f94caa53ab519bc808a17fc9ac2c52 /t/t1401-symbolic-ref.sh
parent6269c46ada8f0b6249ee5b8c5568e5d7c98d0746 (diff)
parentb77e3bdd978bda6415e819972f962b3b16d22a71 (diff)
Merge branch 'jc/symbolic-ref-no-recurse'
After checking out a "branch" that is a symbolic-ref that points at another branch, "git symbolic-ref HEAD" reports the underlying branch, not the symbolic-ref the user gave checkout as argument. The command learned the "--no-recurse" option to stop after dereferencing a symbolic-ref only once. * jc/symbolic-ref-no-recurse: symbolic-ref: teach "--[no-]recurse" option
Diffstat (limited to 't/t1401-symbolic-ref.sh')
-rwxr-xr-xt/t1401-symbolic-ref.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index 0c204089b8..d708acdb81 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -175,4 +175,18 @@ test_expect_success 'symbolic-ref allows top-level target for non-HEAD' '
test_cmp_rev top-level HEAD
'
+test_expect_success 'symbolic-ref pointing at another' '
+ git update-ref refs/heads/maint-2.37 HEAD &&
+ git symbolic-ref refs/heads/maint refs/heads/maint-2.37 &&
+ git checkout maint &&
+
+ git symbolic-ref HEAD >actual &&
+ echo refs/heads/maint-2.37 >expect &&
+ test_cmp expect actual &&
+
+ git symbolic-ref --no-recurse HEAD >actual &&
+ echo refs/heads/maint >expect &&
+ test_cmp expect actual
+'
+
test_done