Skip to content

Commit f7ed51b

Browse files
committed
[#7021] Fixed error serializing programmatically created commits
1 parent 8005591 commit f7ed51b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/objects/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, repo, binsha, tree=None, author=None, authored_date=None, aut
121121
self.parents = parents
122122
if encoding is not None:
123123
self.encoding = encoding
124-
if gpgsig is not None:
124+
if binsha == '\x00'*20 or gpgsig is not None:
125125
self.gpgsig = gpgsig
126126

127127
@classmethod

0 commit comments

Comments
 (0)