##// END OF EJS Templates
git: ensure diffs don't return None
marcink -
r759:6e82d807 default
parent child Browse files
Show More
@@ -988,14 +988,15 b' class GitRemote(RemoteBase):'
988 988 comm2 = repo[commit_id_1]
989 989 diff_obj = comm1.tree.diff_to_tree(
990 990 comm2.tree, flags=flags, context_lines=context, swap=swap)
991
992 diff_obj.find_similar(flags=pygit2.GIT_DIFF_FIND_RENAMES)
991 similar_flags = 0
992 similar_flags |= pygit2.GIT_DIFF_FIND_RENAMES
993 diff_obj.find_similar(flags=similar_flags)
993 994
994 995 if file_filter:
995 996 for p in diff_obj:
996 997 if p.delta.old_file.path == file_filter:
997 return p.patch
998 return diff_obj.patch
998 return p.patch or ''
999 return diff_obj.patch or ''
999 1000
1000 1001 @reraise_safe_exceptions
1001 1002 def node_history(self, wire, commit_id, path, limit):
General Comments 0
You need to be logged in to leave comments. Login now