-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parse_pathspec: accept :(icase)path syntax
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Nguyễn Thái Ngọc Duy
authored and
Junio C Hamano
committed
Jul 15, 2013
1 parent
bd30c2e
commit 93d9353
Showing
11 changed files
with
257 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/bin/sh | ||
|
||
test_description='test case insensitive pathspec limiting' | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'create commits with glob characters' ' | ||
test_commit bar bar && | ||
test_commit bAr bAr && | ||
test_commit BAR BAR && | ||
mkdir foo && | ||
test_commit foo/bar foo/bar && | ||
test_commit foo/bAr foo/bAr && | ||
test_commit foo/BAR foo/BAR && | ||
mkdir fOo && | ||
test_commit fOo/bar fOo/bar && | ||
test_commit fOo/bAr fOo/bAr && | ||
test_commit fOo/BAR fOo/BAR && | ||
mkdir FOO && | ||
test_commit FOO/bar FOO/bar && | ||
test_commit FOO/bAr FOO/bAr && | ||
test_commit FOO/BAR FOO/BAR | ||
' | ||
|
||
test_expect_success 'tree_entry_interesting matches bar' ' | ||
echo bar >expect && | ||
git log --format=%s -- "bar" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'tree_entry_interesting matches :(icase)bar' ' | ||
cat <<-EOF >expect && | ||
BAR | ||
bAr | ||
bar | ||
EOF | ||
git log --format=%s -- ":(icase)bar" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'tree_entry_interesting matches :(icase)bar with prefix' ' | ||
cat <<-EOF >expect && | ||
fOo/BAR | ||
fOo/bAr | ||
fOo/bar | ||
EOF | ||
( cd fOo && git log --format=%s -- ":(icase)bar" ) >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'tree_entry_interesting matches :(icase)bar with empty prefix' ' | ||
cat <<-EOF >expect && | ||
FOO/BAR | ||
FOO/bAr | ||
FOO/bar | ||
fOo/BAR | ||
fOo/bAr | ||
fOo/bar | ||
foo/BAR | ||
foo/bAr | ||
foo/bar | ||
EOF | ||
( cd fOo && git log --format=%s -- ":(icase)../foo/bar" ) >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'match_pathspec_depth matches :(icase)bar' ' | ||
cat <<-EOF >expect && | ||
BAR | ||
bAr | ||
bar | ||
EOF | ||
git ls-files ":(icase)bar" >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'match_pathspec_depth matches :(icase)bar with prefix' ' | ||
cat <<-EOF >expect && | ||
fOo/BAR | ||
fOo/bAr | ||
fOo/bar | ||
EOF | ||
( cd fOo && git ls-files --full-name ":(icase)bar" ) >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_expect_success 'match_pathspec_depth matches :(icase)bar with empty prefix' ' | ||
cat <<-EOF >expect && | ||
bar | ||
fOo/BAR | ||
fOo/bAr | ||
fOo/bar | ||
EOF | ||
( cd fOo && git ls-files --full-name ":(icase)bar" ../bar ) >actual && | ||
test_cmp expect actual | ||
' | ||
|
||
test_done |
Oops, something went wrong.