From 367c5f36a6a0fa7f8f706b10f9bb2f0e28baaa1a Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Mon, 23 Aug 2021 14:30:21 +0200 Subject: commit-graph: show "unexpected subcommand" error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring the "commit-graph" command in line with the error output and general pattern in cmd_multi_pack_index(). Let's test for that output, and also cover the same potential bug as was fixed in the multi-pack-index command in 88617d11f9d (multi-pack-index: fix potential segfault without sub-command, 2021-07-19). Signed-off-by: Ævar Arnfjörð Bjarmason Reviewed-by: Taylor Blau Signed-off-by: Junio C Hamano --- builtin/commit-graph.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin/commit-graph.c') diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 0457903f18..21fc6e934b 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -345,6 +345,7 @@ int cmd_commit_graph(int argc, const char **argv, const char *prefix) 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); -- cgit v1.2.3