Skip to content

Commit de5bc8f

Browse files
Rick CopelandByron
Rick Copeland
authored andcommitted
Handle filenames with embedded spaces when generating diffs
1 parent c083f3d commit de5bc8f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/git/diff.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def _index_from_raw_format(cls, repo, stream):
342342
if not line.startswith(":"):
343343
continue
344344
# END its not a valid diff line
345-
old_mode, new_mode, a_blob_id, b_blob_id, change_type, path = line[1:].split()
345+
old_mode, new_mode, a_blob_id, b_blob_id, change_type, path = line[1:].split(None, 5)
346346
a_path = path
347347
b_path = path
348348
deleted_file = False

test/git/test_refs.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_tag_base(self):
3737
assert tagobj.tag == tag.name
3838
assert isinstance( tagobj.tagger, Actor )
3939
assert isinstance( tagobj.tagged_date, int )
40+
assert isinstance( tagobj.tagger_tz_offset, int )
4041
assert tagobj.message
4142
# END if we have a tag object
4243
# END for tag in repo-tags

0 commit comments

Comments
 (0)