]> git.ipfire.org Git - thirdparty/git.git/commitdiff
MyFirstObjectWalk: fix filtered object walk
authorDirk Gouders <dirk@gouders.net>
Wed, 27 Mar 2024 11:22:14 +0000 (12:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Mar 2024 16:24:34 +0000 (09:24 -0700)
Commit f0d2f84919 (MyFirstObjectWalk: update recommended usage,
2022-03-09) changed a call of parse_list_objects_filter() in a way
that probably never worked: parse_list_objects_filter() always needed
a pointer as its first argument.

Fix this by removing the CALLOC_ARRAY and passing the address of
rev->filter to parse_list_objects_filter() in accordance to
such a call in revisions.c, for example.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/MyFirstObjectWalk.txt

index c33d22ae99b32ed925efd8191f1102c9ba87fa97..a06c712e469e7a3126e494e4a853af1c60a90ae0 100644 (file)
@@ -734,8 +734,8 @@ walk we've just performed:
        } else {
                trace_printf(
                        _("Filtered object walk with filterspec 'tree:1'.\n"));
-               CALLOC_ARRAY(rev->filter, 1);
-               parse_list_objects_filter(rev->filter, "tree:1");
+
+               parse_list_objects_filter(&rev->filter, "tree:1");
        }
        traverse_commit_list(rev, walken_show_commit,
                             walken_show_object, NULL);