Handle empty blobs when diffing

This commit is contained in:
Correl Roush 2010-11-19 15:06:34 -05:00
parent 6d9bc6777b
commit 8c28812654

View file

@ -37,8 +37,8 @@ class Diff(object):
diff = difflib.unified_diff( diff = difflib.unified_diff(
a, a,
b, b,
fromfile=self.a.path, fromfile=self.a.path if self.a else '/dev/null',
tofile=self.b.path, tofile=self.b.path if self.b else '/dev/null',
n=context, n=context,
lineterm='') lineterm='')
return "\n".join(diff) return "\n".join(diff)