aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-07-10 14:17:52 -0700
committerJunio C Hamano <gitster@pobox.com>2015-07-10 14:17:52 -0700
commit89bf01361e09763fa1b30294afad21e123861394 (patch)
tree1fe0c0077f705d964e679bd56439e090503fd71a
parentc07173f2156cb81661f0a9c33b99d9378f3e104c (diff)
parentae454f6125dd492c78eaf0b8709d4779bc0cbe7a (diff)
downloadgit-89bf01361e09763fa1b30294afad21e123861394.tar.gz
git-89bf01361e09763fa1b30294afad21e123861394.tar.xz
Merge branch 'nd/dwim-wildcards-as-pathspecs'
Test updates to a topic already in 2.5-rc. * nd/dwim-wildcards-as-pathspecs: Add tests for wildcard "path vs ref" disambiguation
-rwxr-xr-xt/t2019-checkout-ambiguous-ref.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t2019-checkout-ambiguous-ref.sh b/t/t2019-checkout-ambiguous-ref.sh
index b99d5192a..8396320d5 100755
--- a/t/t2019-checkout-ambiguous-ref.sh
+++ b/t/t2019-checkout-ambiguous-ref.sh
@@ -56,4 +56,30 @@ test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' '
test_i18ngrep ! "^HEAD is now at" stderr
'
+test_expect_success 'wildcard ambiguation, paths win' '
+ git init ambi &&
+ (
+ cd ambi &&
+ echo a >a.c &&
+ git add a.c &&
+ echo b >a.c &&
+ git checkout "*.c" &&
+ echo a >expect &&
+ test_cmp expect a.c
+ )
+'
+
+test_expect_success 'wildcard ambiguation, refs lose' '
+ git init ambi2 &&
+ (
+ cd ambi2 &&
+ echo a >"*.c" &&
+ git add . &&
+ test_must_fail git show :"*.c" &&
+ git show :"*.c" -- >actual &&
+ echo a >expect &&
+ test_cmp expect actual
+ )
+'
+
test_done