Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcdf7c5a

Browse files
committed
Fix regex
This makes sure we're not matching a \n here by accident. It's nowalmost the same as the original that used \S+, except that spaces arenot eaten at the end of the string (for files that end in a space).
1 parent55d40df commitcdf7c5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ class Diff(object):
208208
(?:^deleted[ ]file[ ]mode[ ](?P<deleted_file_mode>.+)(?:\n|$))?
209209
(?:^index[ ](?P<a_blob_id>[0-9A-Fa-f]+)
210210
\.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
211-
(?:^---[ ](?:a/)?(?P<a_path>.*)(?:\n|$))?
212-
(?:^\+\+\+[ ](?:b/)?(?P<b_path>.*)(?:\n|$))?
211+
(?:^---[ ](?:a/)?(?P<a_path>[^\t\n\r\f\v]*)[\t\r\f\v]*(?:\n|$))?
212+
(?:^\+\+\+[ ](?:b/)?(?P<b_path>[^\t\n\r\f\v]*)[\t\r\f\v]*(?:\n|$))?
213213
""".encode('ascii'),re.VERBOSE|re.MULTILINE)
214214
# can be used for comparisons
215215
NULL_HEX_SHA="0"*40

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp