]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/ignore-replace-while-working-on-commit-graph'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Nov 2021 20:48:08 +0000 (13:48 -0700)
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

1  2 
builtin/commit-graph.c
t/t5318-commit-graph.sh

index ab8e5cd59af3ea03bc100279a24dc8aec4478260,2780816820532a16ac7f0b5f6ce04a33784fa40e..4247fbde95af2772f69f9160db07db039c44cda4
@@@ -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);
  }
Simple merge