Skip to content

Commit

Permalink
Skip lines with spaces only in .gitignore
Browse files Browse the repository at this point in the history
fix #878
  • Loading branch information
gtors committed Jun 8, 2021
1 parent 642d726 commit 00b5110
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dulwich/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def read_ignore_patterns(f: BinaryIO) -> Iterable[bytes]:
line = line.rstrip(b"\r\n")

# Ignore blank lines, they're used for readability.
if not line:
if not line.strip():
continue

if line.startswith(b"#"):
Expand Down
2 changes: 1 addition & 1 deletion dulwich/tests/test_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_read_file(self):
f = BytesIO(
b"""
# a comment
\x20\x20
# and an empty line:
\\#not a comment
Expand Down

0 comments on commit 00b5110

Please sign in to comment.