Skip to content

Commit 20a5fd8

Browse files
committed
rev-list --count: comment on the use of count_right++
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3ab3185 commit 20a5fd8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

builtin/rev-list.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ static void show_object(struct object *obj, const char *name, void *cb_data)
262262
return;
263263

264264
if (revs->count) {
265+
/*
266+
* The object count is always accumulated in the .count_right
267+
* field for traversal that is not a left-right traversal,
268+
* and cmd_rev_list() made sure that a .count request that
269+
* wants to count non-commit objects, which is handled by
270+
* the show_object() callback, does not ask for .left_right.
271+
*/
265272
revs->count_right++;
266273
return;
267274
}

0 commit comments

Comments
 (0)