]> git.ipfire.org Git - thirdparty/git.git/commitdiff
docs: fix places that break compilation in MyFirstObjectWalk
authorJohn Cai <johncai86@gmail.com>
Fri, 29 Oct 2021 19:52:42 +0000 (19:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Oct 2021 20:02:45 +0000 (13:02 -0700)
Two errors in the example code caused compilation failures due to
a missing semicolon as well as initialization with an empty struct.
This commit fixes that to make the MyFirstObjectWalk tutorial easier to
follow.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/MyFirstObjectWalk.txt

index 45eb84d8b489e4f1859fb7f2301ceff05953029a..bf0a7c1f76684de98a58ef55e977916672a6a92f 100644 (file)
@@ -65,7 +65,7 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
        const char * const walken_usage[] = {
                N_("git walken"),
                NULL,
-       }
+       };
        struct option options[] = {
                OPT_END()
        };
@@ -697,7 +697,7 @@ First, we'll need to `#include "list-objects-filter-options.h"` and set up the
 ----
 static void walken_object_walk(struct rev_info *rev)
 {
-       struct list_objects_filter_options filter_options = {};
+       struct list_objects_filter_options filter_options = { 0 };
 
        ...
 ----