git: avoid looking-up parents for the null commit
Differential Revision: https://phab.mercurial-scm.org/D8541
--- a/hgext/git/gitlog.py Mon May 11 21:56:43 2020 +0200
+++ b/hgext/git/gitlog.py Mon May 11 21:56:11 2020 +0200
@@ -270,7 +270,10 @@
def parentrevs(self, rev):
n = self.node(rev)
hn = gitutil.togitnode(n)
- c = self.gitrepo[hn]
+ if hn != gitutil.nullgit:
+ c = self.gitrepo[hn]
+ else:
+ return nodemod.nullrev, nodemod.nullrev
p1 = p2 = nodemod.nullrev
if c.parents:
p1 = self.rev(c.parents[0].id.raw)