summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Johns <cjohns@slashdotmedia.com>2013-04-11 18:39:03 +0000
committerCory Johns <cjohns@slashdotmedia.com>2013-04-11 18:39:42 +0000
commitdb82455bd91ce00c22f6ee2b0dc622f117f07137 (patch)
tree3e34ffbd688faacd55f43d85eefcb4960c0969b6
parent007bd4b8190a6e85831c145e0aed5c68594db556 (diff)
downloadgitpython-db82455bd91ce00c22f6ee2b0dc622f117f07137.tar.gz
[#6078] #102 Work-around mergetag blocks by ignoring them
-rw-r--r--git/objects/commit.py9
1 files changed, 8 insertions, 1 deletions
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:]