diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-02-12 12:41:35 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-12 12:41:35 -0800 |
commit | 341f8a6476d1d25c3906696489d87fc381739b59 (patch) | |
tree | 374572d5f341ca93ceef7129bde941187d763fec /t | |
parent | Merge branch 'jn/pretend-object-doc' (diff) | |
parent | verify_filename(): handle backslashes in "wildcards are pathspecs" rule (diff) | |
download | tgif-341f8a6476d1d25c3906696489d87fc381739b59.tar.xz |
Merge branch 'jk/escaped-wildcard-dwim'
Disambiguation logic to tell revisions and pathspec apart has been
tweaked so that backslash-escaped glob special characters do not
count in the "wildcards are pathspec" rule.
* jk/escaped-wildcard-dwim:
verify_filename(): handle backslashes in "wildcards are pathspecs" rule
Diffstat (limited to 't')
-rwxr-xr-x | t/t1506-rev-parse-diagnosis.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh index 6d951ca015..8a75f37a11 100755 --- a/t/t1506-rev-parse-diagnosis.sh +++ b/t/t1506-rev-parse-diagnosis.sh @@ -222,4 +222,18 @@ test_expect_success 'reject Nth ancestor if N is too high' ' test_must_fail git rev-parse HEAD~100000000000000000000000000000000 ' +test_expect_success 'pathspecs with wildcards are not ambiguous' ' + echo "*.c" >expect && + git rev-parse "*.c" >actual && + test_cmp expect actual +' + +test_expect_success 'backslash does not trigger wildcard rule' ' + test_must_fail git rev-parse "foo\\bar" +' + +test_expect_success 'escaped char does not trigger wildcard rule' ' + test_must_fail git rev-parse "foo\\*bar" +' + test_done |