Browse Source

ignore: question mark should not match slash

pared 6 years ago
parent
commit
5219d79334
2 changed files with 2 additions and 1 deletions
  1. 1 1
      dulwich/ignore.py
  2. 1 0
      dulwich/tests/test_ignore.py

+ 1 - 1
dulwich/ignore.py

@@ -38,7 +38,7 @@ def _translate_segment(segment):
         if c == b'*':
             res += b'[^/]*'
         elif c == b'?':
-            res += b'.'
+            res += b'[^/]'
         elif c == b'[':
             j = i
             if j < n and segment[j:j+1] == b'!':

+ 1 - 0
dulwich/tests/test_ignore.py

@@ -65,6 +65,7 @@ NEGATIVE_MATCH_TESTS = [
     (b"foo/foo.c", b"/*.c"),
     (b"foo/bar/", b"/bar/"),
     (b"foo/bar/", b"foo/bar/*"),
+    (b"foo/bar", b"foo?bar")
 ]