# HG changeset patch # User Marcin Kuzminski # Date 2012-06-20 23:34:11 # Node ID c919d8c4f6a29da5dccd7fa8ed1c9478ae125eeb # Parent 9989d727ef1bb968e87ce071b00e96f5f889ed33 fixed git diff function when initial revision had no parents to compare with diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py --- a/rhodecode/lib/vcs/backends/git/changeset.py +++ b/rhodecode/lib/vcs/backends/git/changeset.py @@ -195,7 +195,9 @@ class GitChangeset(BaseChangeset): return _prev(self, branch) def diff(self, ignore_whitespace=True, context=3): - return ''.join(self.repository.get_diff(self, self.parents[0], + rev1 = self.parents[0] if self.parents else self.repository.EMPTY_CHANGESET + rev2 = self + return ''.join(self.repository.get_diff(rev1, rev2, ignore_whitespace=ignore_whitespace, context=context))