From: Junio C Hamano Date: Mon, 1 Nov 2021 20:48:08 +0000 (-0700) Subject: Merge branch 'ab/ignore-replace-while-working-on-commit-graph' X-Git-Tag: v2.34.0-rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b82299ec6fe245595b3ac4abf5458bcb032ba62e;p=thirdparty%2Fgit.git Merge branch 'ab/ignore-replace-while-working-on-commit-graph' Teach "git commit-graph" command not to allow using replace objects at all, as we do not use the commit-graph at runtime when we see object replacement. * 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 --- b82299ec6fe245595b3ac4abf5458bcb032ba62e diff --cc builtin/commit-graph.c index ab8e5cd59a,2780816820..4247fbde95 --- 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); }