summaryrefslogtreecommitdiff
path: root/t/t3700-add.sh
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2008-08-13 15:34:34 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-13 17:11:03 -0700
commitea335b56d44a92b9b8be40b1465d7df65a4f736b (patch)
tree8fb43988263fce307dc046d5b4c1cb7d078d0a63 /t/t3700-add.sh
parent9612e74342cfd38c0b83230a2c847cd070599a5a (diff)
downloadgit-ea335b56d44a92b9b8be40b1465d7df65a4f736b.tar.gz
Fix escaping of glob special characters in pathspecs
match_one implements an optimized pathspec match where it only uses fnmatch if it detects glob special characters in the pattern. Unfortunately it didn't treat \ as a special character, so attempts to escape a glob special character would fail even though fnmatch() supports it. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3700-add.sh')
-rwxr-xr-xt/t3700-add.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index e83fa1f689..fcbc203e71 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -222,4 +222,12 @@ test_expect_success 'git add (add.ignore-errors = false)' '
! ( git ls-files foo1 | grep foo1 )
'
+test_expect_success 'git add '\''fo\?bar'\'' ignores foobar' '
+ git reset --hard &&
+ touch fo\?bar foobar &&
+ git add '\''fo\?bar'\'' &&
+ git ls-files fo\?bar | grep -F fo\?bar &&
+ ! ( git ls-files foobar | grep foobar )
+'
+
test_done