aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-19 23:25:38 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-19 23:25:38 -0700
commita91df69cbb5ced7837525106ff57ff349180770b (patch)
tree748170216a91f1a9f3617a49e9f34d21120e0db4 /builtin
parent06a054014b23494f5ace2699e2aaf7b35757e010 (diff)
parent251df09be3af658404f5f5f670a013d5806645d4 (diff)
downloadgit-a91df69cbb5ced7837525106ff57ff349180770b.tar.gz
git-a91df69cbb5ced7837525106ff57ff349180770b.tar.xz
Merge branch 'mm/maint-log-n-with-diff-filtering'
* mm/maint-log-n-with-diff-filtering: log: fix --max-count when used together with -S or -G
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 99e33b365..796e9e574 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -263,7 +263,13 @@ static int cmd_log_walk(struct rev_info *rev)
* retain that state information if replacing rev->diffopt in this loop
*/
while ((commit = get_revision(rev)) != NULL) {
- log_tree_commit(rev, commit);
+ if (!log_tree_commit(rev, commit) &&
+ rev->max_count >= 0)
+ /*
+ * We decremented max_count in get_revision,
+ * but we didn't actually show the commit.
+ */
+ rev->max_count++;
if (!rev->reflog_info) {
/* we allow cycles in reflog ancestry */
free(commit->buffer);