Skip to content

Commit 07f9247

Browse files
ltuikovJunio C Hamano
authored andcommitted
max-count in terms of intersection
When a path designation is given, max-count counts the number of commits therein (intersection), not globally. This avoids the case where in case path has been inactive for the last N commits, --max-count=N and path designation at git-rev-list is given, would give no commits. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent c3df856 commit 07f9247

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rev-list.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ static int filter_commit(struct commit * commit)
124124
stop_traversal=1;
125125
return CONTINUE;
126126
}
127-
if (max_count != -1 && !max_count--)
128-
return STOP;
129127
if (no_merges && (commit->parents && commit->parents->next))
130128
return CONTINUE;
131129
if (paths && dense) {
@@ -148,6 +146,9 @@ static int process_commit(struct commit * commit)
148146
return CONTINUE;
149147
}
150148

149+
if (max_count != -1 && !max_count--)
150+
return STOP;
151+
151152
show_commit(commit);
152153

153154
return CONTINUE;

0 commit comments

Comments
 (0)