diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-10-15 12:53:14 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-10-15 12:53:14 +0200 |
commit | 94029ce1420ced83c3e5dcd181a2280b26574bc9 (patch) | |
tree | 5b2f2841597153669c546379291ad8693834800d | |
parent | 13647590f96fb5a22cb60f12c5a70e00065a7f3a (diff) | |
download | gitpython-94029ce1420ced83c3e5dcd181a2280b26574bc9.tar.gz |
Adjusted regex to support whitespace - it was a little restrictive previously, although there was absolutely no need for that.
See http://byronimo.lighthouseapp.com/projects/51787/tickets/41-diff-regex-lib_git_diffpy-cannot-handle-paths-with-spaces
-rw-r--r-- | lib/git/diff.py | 2 | ||||
-rw-r--r-- | test/fixtures/diff_2 | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/git/diff.py b/lib/git/diff.py index e1749adc..48253c42 100644 --- a/lib/git/diff.py +++ b/lib/git/diff.py @@ -175,7 +175,7 @@ class Diff(object): # precompiled regex re_header = re.compile(r""" #^diff[ ]--git - [ ]a/(?P<a_path>\S+)[ ]b/(?P<b_path>\S+)\n + [ ]a/(?P<a_path>.+?)[ ]b/(?P<b_path>.+?)\n (?:^similarity[ ]index[ ](?P<similarity_index>\d+)%\n ^rename[ ]from[ ](?P<rename_from>\S+)\n ^rename[ ]to[ ](?P<rename_to>\S+)(?:\n|$))? diff --git a/test/fixtures/diff_2 b/test/fixtures/diff_2 index 1f060c70..218b6bae 100644 --- a/test/fixtures/diff_2 +++ b/test/fixtures/diff_2 @@ -1,7 +1,7 @@ diff --git a/lib/grit/commit.rb b/lib/grit/commit.rb index a093bb1db8e884cccf396b297259181d1caebed4..80fd3d527f269ecbd570b65b8e21fd85baedb6e9 100644 ---- a/lib/grit/commit.rb -+++ b/lib/grit/commit.rb +--- a/lib/grit/com mit.rb ++++ b/lib/grit/com mit.rb @@ -156,12 +156,8 @@ module Grit def diffs |