"**" 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 <pclo...@gmail.com>
 t/t3001-ls-files-others-exclude.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/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

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to