summaryrefslogtreecommitdiff
path: root/lib/git
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-06 11:09:14 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-06 11:09:14 +0100
commit4114d19e2c02f3ffca9feb07b40d9475f36604cc (patch)
treeb503ccd4b1ba0ee13e6a0311a9f6fae78011754f /lib/git
parent1da744421619e134ed3ff2781b4d97fee78d9cd4 (diff)
downloadgitpython-4114d19e2c02f3ffca9feb07b40d9475f36604cc.tar.gz
Fixed commit.count method which now handles the paths case properly. It appears git-rev-list uses empty paths in some way, which is quite hard to specify on a shell, but easy if the process is spawned directly
Diffstat (limited to 'lib/git')
-rw-r--r--lib/git/objects/commit.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py
index 80b3ad23..4ec806fb 100644
--- a/lib/git/objects/commit.py
+++ b/lib/git/objects/commit.py
@@ -116,7 +116,13 @@ class Commit(base.Object, Iterable, diff.Diffable):
Returns
int
"""
- return len(self.repo.git.rev_list(self.sha, '--', paths, **kwargs).strip().splitlines())
+ # yes, it makes a difference whether empty paths are given or not in our case
+ # as the empty paths version will ignore merge commits for some reason.
+ if paths:
+ return len(self.repo.git.rev_list(self.sha, '--', paths, **kwargs).splitlines())
+ else:
+ return len(self.repo.git.rev_list(self.sha, **kwargs).splitlines())
+
@property
def name_rev(self):