We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 84d984c + 7b2b708 commit 3199cd4Copy full SHA for 3199cd4
1 file changed
pathspec/patterns/gitignore/base.py
@@ -47,7 +47,7 @@ def escape(s: AnyStr) -> AnyStr:
47
raise TypeError(f"s:{s!r} is not a unicode or byte string.")
48
49
# Reference: https://git-scm.com/docs/gitignore#_pattern_format
50
- out_string = ''.join((f"\\{x}" if x in '[]!*#?' else x) for x in string)
+ out_string = ''.join((f"\\{x}" if x in '\\[]!*#?' else x) for x in string)
51
52
if return_type is bytes:
53
return out_string.encode(_BYTES_ENCODING)
0 commit comments