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
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 08:42:12 +0400
committerJunio C Hamano <gitster@pobox.com>2009-04-18 08:42:12 +0400
commita9b772a0116869f0f93e57ca0b49fd66325bb04a (patch)
tree21ff148b24d3a0239d5a68a647a6884569a4a5d2 /t
parentbd15ef078afac3f0f147e815d3b85d6d2a48dd1a (diff)
parent45972ffbedf8175555434006595c71a5b0e643f1 (diff)
Merge branch 'bw/short-ref-strict'
* bw/short-ref-strict: remote.c: use shorten_unambiguous_ref rev-parse: --abbrev-ref option to shorten ref name for-each-ref: utilize core.warnAmbiguousRefs for :short-format shorten_unambiguous_ref(): add strict mode
Diffstat (limited to 't')
-rwxr-xr-xt/t6300-for-each-ref.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index daf02d5c10..8052c86ad3 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -301,10 +301,11 @@ test_expect_success 'Check for invalid refname format' '
cat >expected <<\EOF
heads/master
-master
+tags/master
EOF
-test_expect_success 'Check ambiguous head and tag refs' '
+test_expect_success 'Check ambiguous head and tag refs (strict)' '
+ git config --bool core.warnambiguousrefs true &&
git checkout -b newtag &&
echo "Using $datestamp" > one &&
git add one &&
@@ -316,11 +317,22 @@ test_expect_success 'Check ambiguous head and tag refs' '
'
cat >expected <<\EOF
+heads/master
+master
+EOF
+
+test_expect_success 'Check ambiguous head and tag refs (loose)' '
+ git config --bool core.warnambiguousrefs false &&
+ git for-each-ref --format "%(refname:short)" refs/heads/master refs/tags/master >actual &&
+ test_cmp expected actual
+'
+
+cat >expected <<\EOF
heads/ambiguous
ambiguous
EOF
-test_expect_success 'Check ambiguous head and tag refs II' '
+test_expect_success 'Check ambiguous head and tag refs II (loose)' '
git checkout master &&
git tag ambiguous testtag^0 &&
git branch ambiguous testtag^0 &&