]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rev-list --count: comment on the use of count_right++
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2020 21:21:46 +0000 (13:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2020 21:21:46 +0000 (13:21 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-list.c

index 35e14ad2edc76e972db7ae8a5d43b1088be1fdc4..f520111eda09f1d167524b31919daaea3e5a5a31 100644 (file)
@@ -262,6 +262,13 @@ static void show_object(struct object *obj, const char *name, void *cb_data)
                return;
 
        if (revs->count) {
+               /*
+                * The object count is always accumulated in the .count_right
+                * field for traversal that is not a left-right traversal,
+                * and cmd_rev_list() made sure that a .count request that
+                * wants to count non-commit objects, which is handled by
+                * the show_object() callback, does not ask for .left_right.
+                */
                revs->count_right++;
                return;
        }