Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix regex
This makes sure we're not matching a \n here by accident.  It's now
almost the same as the original that used \S+, except that spaces are
not eaten at the end of the string (for files that end in a space).
  • Loading branch information
nvie committed Apr 19, 2016
commit cdf7c5aca2201cf9dfc3cd301264da4ea352b737
4 changes: 2 additions & 2 deletions git/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ class Diff(object):
(?:^deleted[ ]file[ ]mode[ ](?P<deleted_file_mode>.+)(?:\n|$))?
(?:^index[ ](?P<a_blob_id>[0-9A-Fa-f]+)
\.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
(?:^---[ ](?:a/)?(?P<a_path>.*)(?:\n|$))?
(?:^\+\+\+[ ](?:b/)?(?P<b_path>.*)(?:\n|$))?
(?:^---[ ](?:a/)?(?P<a_path>[^\t\n\r\f\v]*)[\t\r\f\v]*(?:\n|$))?
(?:^\+\+\+[ ](?:b/)?(?P<b_path>[^\t\n\r\f\v]*)[\t\r\f\v]*(?:\n|$))?
""".encode('ascii'), re.VERBOSE | re.MULTILINE)
# can be used for comparisons
NULL_HEX_SHA = "0" * 40
Expand Down