mercurial/patch.py
changeset 14385 7709cc983025
parent 14384 9d59c596eb9e
child 14386 c2ef8cc50748
--- a/mercurial/patch.py	Thu May 19 22:44:01 2011 +0200
+++ b/mercurial/patch.py	Thu May 19 22:44:01 2011 +0200
@@ -1158,14 +1158,12 @@
                 if not git:
                     git = True
                     gitpatches = scangitpatch(lr, x)
-                    yield 'git', gitpatches
                     for gp in gitpatches:
                         changed[gp.path] = gp
-                # else error?
+                    yield 'git', gitpatches
                 # copy/rename + modify should modify target, not source
-                gp = changed.get(bfile)
-                if gp and (gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD')
-                           or gp.mode):
+                gp = changed[bfile]
+                if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode:
                     afile = bfile
                 newfile = True
         elif x.startswith('---'):