]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/ignore-replace-while-working-on-commit-graph' into gc/use-repo-settings
authorJunio C Hamano <gitster@pobox.com>
Fri, 15 Oct 2021 21:30:00 +0000 (14:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Oct 2021 21:30:00 +0000 (14:30 -0700)
* 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 3c3de3a156f1e2afc2b4952cf38e8d1136ad4716,2780816820532a16ac7f0b5f6ce04a33784fa40e..fb8e166a26f6102b40ec36965cd6db71fdb74531
@@@ -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