Skip to content

Commit 89bf013

Browse files
committed
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
2 parents c07173f + ae454f6 commit 89bf013

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

t/t2019-checkout-ambiguous-ref.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,30 @@ test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' '
5656
test_i18ngrep ! "^HEAD is now at" stderr
5757
'
5858

59+
test_expect_success 'wildcard ambiguation, paths win' '
60+
git init ambi &&
61+
(
62+
cd ambi &&
63+
echo a >a.c &&
64+
git add a.c &&
65+
echo b >a.c &&
66+
git checkout "*.c" &&
67+
echo a >expect &&
68+
test_cmp expect a.c
69+
)
70+
'
71+
72+
test_expect_success 'wildcard ambiguation, refs lose' '
73+
git init ambi2 &&
74+
(
75+
cd ambi2 &&
76+
echo a >"*.c" &&
77+
git add . &&
78+
test_must_fail git show :"*.c" &&
79+
git show :"*.c" -- >actual &&
80+
echo a >expect &&
81+
test_cmp expect actual
82+
)
83+
'
84+
5985
test_done

0 commit comments

Comments
 (0)