From db82455bd91ce00c22f6ee2b0dc622f117f07137 Mon Sep 17 00:00:00 2001 From: Cory Johns Date: Thu, 11 Apr 2013 18:39:03 +0000 Subject: [#6078] #102 Work-around mergetag blocks by ignoring them --- git/objects/commit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'git/objects/commit.py') diff --git a/git/objects/commit.py b/git/objects/commit.py index fd4187b0..8e74f8bf 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -426,11 +426,18 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): self.committer, self.committed_date, self.committer_tz_offset = parse_actor_and_date(readline()) + # we might run into one or more mergetag blocks, skip those for now + next_line = readline() + while next_line.startswith('mergetag '): + next_line = readline() + while next_line.startswith(' '): + next_line = readline() + # now we can have the encoding line, or an empty line followed by the optional # message. self.encoding = self.default_encoding # read encoding or empty line to separate message - enc = readline() + enc = next_line enc = enc.strip() if enc: self.encoding = enc[enc.find(' ')+1:] -- cgit v1.2.1