diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-19 23:25:38 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-19 23:25:38 -0700 |
commit | a91df69cbb5ced7837525106ff57ff349180770b (patch) | |
tree | 748170216a91f1a9f3617a49e9f34d21120e0db4 /builtin/log.c | |
parent | 06a054014b23494f5ace2699e2aaf7b35757e010 (diff) | |
parent | 251df09be3af658404f5f5f670a013d5806645d4 (diff) | |
download | git-a91df69cbb5ced7837525106ff57ff349180770b.tar.gz |
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/log.c')
-rw-r--r-- | builtin/log.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c index 99e33b3651..796e9e5746 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); |