8000 Reads the predecessor headers from the commit · gitpython-developers/GitPython@c7eb6e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7eb6e7

Browse files
committed
Reads the predecessor headers from the commit
1 parent 42ec41d commit c7eb6e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git/objects/commit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ def _deserialize(self, stream):
497497
self.gpgsig = None
498498

499499
# read headers
500+
self.predecessors = list()
500501
enc = next_line
501502
buf = enc.strip()
502503
while buf:
@@ -518,6 +519,9 @@ def _deserialize(self, stream):
518519
self.gpgsig = sig.rstrip(b"\n").decode('ascii')
519520
if is_next_header:
520521
continue
522+
elif buf[0:12] == b"predecessor ":
523+
predecessor_sha = buf[buf.find(b' ') + 1:].decode('ascii')
524+
self.predecessors.append(type(self)(self.repo, hex_to_bin(predecessor_sha)))
521525
buf = readline().strip()
522526
# decode the authors name
523527

0 commit comments

Comments
 (0)
0