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(
a,
b,
fromfile=self.a.path,
tofile=self.b.path,
fromfile=self.a.path if self.a else '/dev/null',
tofile=self.b.path if self.b else '/dev/null',
n=context,
lineterm='')
return "\n".join(diff)