Skip to content

Commit 6e77e26

Browse files
Fix lint and mypy errors
- Remove whitespace from blank lines in docstrings (ruff W293) - Use !r format specifier for bytes in f-string (mypy str-bytes-safe)
1 parent 6ef056f commit 6e77e26

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

git/diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def decode_path(path: bytes, has_ab_prefix: bool = True) -> Optional[bytes]:
116116
# Support standard (a/b) and mnemonicPrefix (c/w/i/o/h) prefixes
117117
# See git-config diff.mnemonicPrefix documentation
118118
valid_prefixes = (b"a/", b"b/", b"c/", b"w/", b"i/", b"o/", b"h/")
119-
assert any(path.startswith(p) for p in valid_prefixes), f"Unexpected path prefix: {path[:10]}"
119+
assert any(path.startswith(p) for p in valid_prefixes), f"Unexpected path prefix: {path[:10]!r}"
120120
path = path[2:]
121121

122122
return path

test/test_diff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ def test_diff_unsafe_paths(self):
283283

284284
def test_diff_mnemonic_prefix(self):
285285
"""Test that diff parsing works with mnemonicPrefix enabled.
286-
286+
287287
When diff.mnemonicPrefix=true is set in git config, git uses different
288288
prefixes for diff paths:
289289
- c/ for commit
290-
- w/ for worktree
290+
- w/ for worktree
291291
- i/ for index
292292
- o/ for object
293-
293+
294294
This addresses issue #2013 where the regex only matched [ab]/ prefixes.
295295
"""
296296
# Create a diff with mnemonicPrefix-style c/ and w/ prefixes
@@ -305,7 +305,7 @@ def test_diff_mnemonic_prefix(self):
305305
"""
306306
diff_proc = StringProcessAdapter(diff_mnemonic)
307307
diffs = Diff._index_from_patch_format(self.rorepo, diff_proc)
308-
308+
309309
# Should parse successfully (previously would fail or return empty)
310310
self.assertEqual(len(diffs), 1)
311311
diff = diffs[0]

0 commit comments

Comments
 (0)