Show More
@@ -1149,22 +1149,23 b' def iterhunks(fp):' | |||||
1149 | yield 'file', (afile, bfile, h, gp and gp.mode or None) |
|
1149 | yield 'file', (afile, bfile, h, gp and gp.mode or None) | |
1150 | yield 'hunk', h |
|
1150 | yield 'hunk', h | |
1151 | elif x.startswith('diff --git'): |
|
1151 | elif x.startswith('diff --git'): | |
1152 | # check for git diff, scanning the whole patch file if needed |
|
|||
1153 | m = gitre.match(x) |
|
1152 | m = gitre.match(x) | |
1154 | if m: |
|
1153 | if not m: | |
1155 |
|
|
1154 | continue | |
1156 |
|
|
1155 | if not git: | |
1157 | gitpatches = scangitpatch(lr, x) |
|
1156 | # scan whole input for git metadata | |
1158 | for gp in gitpatches: |
|
1157 | git = True | |
1159 | changed['b/' + gp.path] = gp |
|
1158 | gitpatches = scangitpatch(lr, x) | |
1160 |
|
|
1159 | for gp in gitpatches: | |
1161 |
|
|
1160 | changed['b/' + gp.path] = gp | |
1162 |
|
|
1161 | yield 'git', gitpatches | |
1163 | gp = changed[bfile] |
|
1162 | afile = 'a/' + m.group(1) | |
1164 | # copy/rename + modify should modify target, not source |
|
1163 | bfile = 'b/' + m.group(2) | |
1165 | if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode: |
|
1164 | gp = changed[bfile] | |
1166 | afile = bfile |
|
1165 | # copy/rename + modify should modify target, not source | |
1167 | newfile = True |
|
1166 | if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode: | |
|
1167 | afile = bfile | |||
|
1168 | newfile = True | |||
1168 | elif x.startswith('---'): |
|
1169 | elif x.startswith('---'): | |
1169 | # check for a unified diff |
|
1170 | # check for a unified diff | |
1170 | l2 = lr.readline() |
|
1171 | l2 = lr.readline() |
General Comments 0
You need to be logged in to leave comments.
Login now