mirror of
https://github.com/git/git
synced 2024-10-28 19:25:47 +00:00
Merge branch 'dc/p4-binary-submit-fix'
Prevent "git p4" from failing to submit changes to binary file. * dc/p4-binary-submit-fix: git-p4: fix failed submit by skip non-text data files
This commit is contained in:
commit
b6bd704c3e
1 changed files with 5 additions and 2 deletions
|
@ -1977,8 +1977,11 @@ def get_diff_description(self, editedFiles, filesToAdd, symlinks):
|
|||
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')
|
||||
|
|
Loading…
Reference in a new issue