summaryrefslogtreecommitdiff
path: root/git/objects/commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2014-11-15 16:19:24 +0100
committerSebastian Thiel <byronimo@gmail.com>2014-11-15 16:21:37 +0100
commitff13922f6cfb11128b7651ddfcbbd5cad67e477f (patch)
tree9d999b14a7817b1ceeb23ddd1cded446ace9255c /git/objects/commit.py
parent9c39afa1f85f3293ad2ccef684ff62bf0a36e73c (diff)
parentf7ed51ba4c8416888f5744ddb84726316c461051 (diff)
downloadgitpython-ff13922f6cfb11128b7651ddfcbbd5cad67e477f.tar.gz
Merge branch 'sf-master' of https://github.com/johnsca/GitPython into johnsca-sf-master
Conflicts: git/cmd.py git/objects/commit.py git/objects/fun.py git/objects/util.py git/remote.py git/repo/base.py git/test/lib/helper.py git/test/test_commit.py git/test/test_fun.py git/util.py
Diffstat (limited to 'git/objects/commit.py')
-rw-r--r--git/objects/commit.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py
index 4380f472..bc437e8b 100644
--- a/git/objects/commit.py
+++ b/git/objects/commit.py
@@ -8,6 +8,7 @@ from git.util import (
Actor,
Iterable,
Stats,
+ finalize_process
)
from git.diff import Diffable
from tree import Tree
@@ -65,7 +66,6 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
message=None, parents=None, encoding=None, gpgsig=None):
"""Instantiate a new Commit. All keyword arguments taking None as default will
be implicitly set on first query.
-
:param binsha: 20 byte sha1
:param parents: tuple( Commit, ... )
is a tuple of commit ids or actual Commits
@@ -252,6 +252,10 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
assert len(hexsha) == 40, "Invalid line: %s" % hexsha
yield Commit(repo, hex_to_bin(hexsha))
# END for each line in stream
+ # TODO: Review this - it seems process handling got a bit out of control
+ # due to many developers trying to fix the open file handles issue
+ if hasattr(proc_or_stream, 'wait'):
+ finalize_process(proc_or_stream)
@classmethod
@@ -430,14 +434,21 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
self.author, self.authored_date, self.author_tz_offset = parse_actor_and_date(next_line)
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 headers
- buf = readline().strip()
+ enc = next_line
+ buf = enc.strip()
while buf != "":
if buf[0:10] == "encoding ":
self.encoding = buf[buf.find(' ')+1:]