소스 검색

ignore: question mark should not match slash

pared 6 년 전
부모
커밋
5219d79334
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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")
 ]