changeset 44844:8bfc6cc8e480

git: avoid looking-up parents for the null commit Differential Revision: https://phab.mercurial-scm.org/D8541
author Romain DEP. <rom1dep@gmail.com>
date Mon, 11 May 2020 21:56:11 +0200
parents 288328c6711b
children 3e09d22a0bf5
files hgext/git/gitlog.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)