From 398c4ff582646b099eb1f3b14a525dfe5eeb5420 Mon Sep 17 00:00:00 2001 From: SZEDER Gábor Date: Fri, 19 Aug 2022 18:04:11 +0200 Subject: builtin/worktree.c: let parse-options parse subcommands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'git worktree' parses its subcommands with a long list of if statements. parse-options has just learned to parse subcommands, so let's use that facility instead, with the benefits of shorter code, handling missing or unknown subcommands, and listing subcommands for Bash completion. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git.c') diff --git a/git.c b/git.c index 73ddf0f452..f52a955410 100644 --- a/git.c +++ b/git.c @@ -627,7 +627,7 @@ static struct cmd_struct commands[] = { { "verify-tag", cmd_verify_tag, RUN_SETUP }, { "version", cmd_version }, { "whatchanged", cmd_whatchanged, RUN_SETUP }, - { "worktree", cmd_worktree, RUN_SETUP | NO_PARSEOPT }, + { "worktree", cmd_worktree, RUN_SETUP }, { "write-tree", cmd_write_tree, RUN_SETUP }, }; -- cgit v1.3-5-g9baa