From: Dirk Gouders Date: Wed, 27 Mar 2024 11:22:14 +0000 (+0100) Subject: MyFirstObjectWalk: fix filtered object walk X-Git-Tag: v2.45.0-rc0~43^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af3888890e7eda11c54f0eca96a69b8178f46bff;p=thirdparty%2Fgit.git MyFirstObjectWalk: fix filtered object walk 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 Signed-off-by: Junio C Hamano --- diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index c33d22ae99..a06c712e46 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -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);