From 8c2881265448701dfcef9c94276f33609c50b2f9 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 19 Nov 2010 15:06:34 -0500 Subject: [PATCH] Handle empty blobs when diffing --- lib/vcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vcs.py b/lib/vcs.py index 4c2aa35..7b72e8a 100644 --- a/lib/vcs.py +++ b/lib/vcs.py @@ -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)