File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ diff --git a/bugtrace/patch.py b/bugtrace/patch.py
2
+ index 18910dfd..2456e34f 100644
3
+ --- a/bugtrace/patch.py
4
+ +++ b/bugtrace/patch.py
5
+ @@ -8,20 +8,30 @@
6
+
Original file line number Diff line number Diff line change @@ -603,6 +603,23 @@ def test_git_header(self):
603
603
results_main = wtp .patch .parse_header (text )
604
604
self .assertEqual (results_main , expected )
605
605
606
+ def test_git_header_long (self ):
607
+ with open ('tests/casefiles/git-header-long.diff' ) as f :
608
+ text = f .read ()
609
+
610
+ expected = wtp .patch .header (
611
+ index_path = None ,
612
+ old_path = 'bugtrace/patch.py' ,
613
+ old_version = '18910dfd' ,
614
+ new_path = 'bugtrace/patch.py' ,
615
+ new_version = '2456e34f' )
616
+
617
+ results = wtp .patch .parse_git_header (text )
618
+ self .assertEqual (results , expected )
619
+
620
+ results_main = wtp .patch .parse_header (text )
621
+ self .assertEqual (results_main , expected )
622
+
606
623
def test_svn_header (self ):
607
624
with open ('tests/casefiles/svn-header.diff' ) as f :
608
625
text = f .read ()
Original file line number Diff line number Diff line change 41
41
42
42
# git has a special index header and no end part
43
43
git_diffcmd_header = re .compile ('^diff --git a/(.+) b/(.+)$' )
44
- git_header_index = re .compile ('^index ([\w]{7} )..([\w]{7} ) ?(\d*)$' )
44
+ git_header_index = re .compile ('^index ([a-f0-9]+ )..([a-f0-9]+ ) ?(\d*)$' )
45
45
git_header_old_line = re .compile ('^--- (.+)$' )
46
46
git_header_new_line = re .compile ('^\+\+\+ (.+)$' )
47
47
git_header_file_mode = re .compile ('^(new|deleted) file mode \d{6}$' )
You can’t perform that action at this time.
0 commit comments