mirror of
https://github.com/correl/codereview.git
synced 2025-04-12 17:00:04 -09:00
Fixed an error when trying to show the initial commit diff
This commit is contained in:
parent
6d22447153
commit
8a2f7a455b
1 changed files with 6 additions and 1 deletions
|
@ -166,7 +166,12 @@ class Git(VCS):
|
||||||
a = b.parents[:1]
|
a = b.parents[:1]
|
||||||
else:
|
else:
|
||||||
a = self._repo.commit(a)
|
a = self._repo.commit(a)
|
||||||
for diff in b.diff(a):
|
if a:
|
||||||
|
diffs = b.diff(a)
|
||||||
|
else:
|
||||||
|
# No parents, use the default behaviour (safe for bare repos)
|
||||||
|
diffs = b.diff()
|
||||||
|
for diff in diffs:
|
||||||
# b and a are swapped so the parent diff will work as a list of
|
# b and a are swapped so the parent diff will work as a list of
|
||||||
# parents. Therefore, we'll swap them back when we put them into our
|
# parents. Therefore, we'll swap them back when we put them into our
|
||||||
# Diff object.
|
# Diff object.
|
||||||
|
|
Loading…
Add table
Reference in a new issue