]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-p4.py
Merge branch 'jk/apply-binary-hunk-parsing-fix'
[thirdparty/git.git] / git-p4.py
index d34a1946b754abaef5f1f0422a82f468d5e59efc..2b4500226aa7a48d2b2644d3b1f351342cda20f4 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1977,8 +1977,11 @@ class P4Submit(Command, P4UserMap):
                 newdiff += "+%s\n" % os.readlink(newFile)
             else:
                 f = open(newFile, "r")
-                for line in f.readlines():
-                    newdiff += "+" + line
+                try:
+                    for line in f.readlines():
+                        newdiff += "+" + line
+                except UnicodeDecodeError:
+                    pass # Found non-text data and skip, since diff description should only include text
                 f.close()
 
         return (diff + newdiff).replace('\r\n', '\n')