From: Junio C Hamano Date: Fri, 15 Oct 2021 21:30:00 +0000 (-0700) Subject: Merge branch 'ab/ignore-replace-while-working-on-commit-graph' into gc/use-repo-settings X-Git-Tag: v2.34.0-rc1~8^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed41385ad65ebf5d6341db96728be357dde3194d;p=thirdparty%2Fgit.git Merge branch 'ab/ignore-replace-while-working-on-commit-graph' into gc/use-repo-settings * ab/ignore-replace-while-working-on-commit-graph: commit-graph: don't consider "replace" objects with "verify" commit-graph tests: fix another graph_git_two_modes() helper commit-graph tests: fix error-hiding graph_git_two_modes() helper --- ed41385ad65ebf5d6341db96728be357dde3194d diff --cc builtin/commit-graph.c index 3c3de3a156,2780816820..fb8e166a26 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@@ -315,18 -326,17 +314,19 @@@ int cmd_commit_graph(int argc, const ch builtin_commit_graph_options, builtin_commit_graph_usage, PARSE_OPT_STOP_AT_NON_OPTION); + if (!argc) + goto usage; + read_replace_refs = 0; save_commit_buffer = 0; - if (argc > 0) { - if (!strcmp(argv[0], "verify")) - return graph_verify(argc, argv); - if (!strcmp(argv[0], "write")) - return graph_write(argc, argv); - } + if (!strcmp(argv[0], "verify")) + return graph_verify(argc, argv); + else if (argc && !strcmp(argv[0], "write")) + return graph_write(argc, argv); + error(_("unrecognized subcommand: %s"), argv[0]); +usage: usage_with_options(builtin_commit_graph_usage, builtin_commit_graph_options); }