"**" currently matches any characters including slashes. It's probably
too powerful. A more sensible definition may be match any characters
that the but the whole match must be wrapped by slashes. So "**" can
match none, "/", "/aaa/", "/aa/bb/" and so on but not "aa/bb".
Note it in the test suite.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
t/t3001-ls-files-others-exclude.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index 6a5a4ab..99b5f5c 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -235,4 +235,12 @@ EOF
test_cmp expect actual
'
+# We might want ** to match at directory boundary, e.g. a**b matches
+# a/b, a/x/b, a/x/x/b... but not ax/xb.
+test_expect_failure 'ls-files with "**" patterns and no slashes' '
+ : >expect &&
+ git ls-files -o -i --exclude "o**a.1" >actual
+ test_cmp expect actual
+'
+
test_done
--
1.7.12.1.405.gb727dc9