From: Felipe Contreras Date: Mon, 05 Jul 2021 12:31:43 GMT Subject: [RFC PATCH 09/35] update: add options and usage skeleton Message-ID: <20210705123209.1808663-10-felipe.contreras@gmail.com> In-Reply-To: <20210705123209.1808663-1-felipe.contreras@gmail.com> Signed-off-by: Felipe Contreras --- builtin/update.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/builtin/update.c b/builtin/update.c index 51e45b453d..1a69896aa8 100644 --- a/builtin/update.c +++ b/builtin/update.c @@ -3,9 +3,19 @@ */ #include "builtin.h" +#include "parse-options.h" #include "run-command.h" #include "dir.h" +static const char * const update_usage[] = { + N_("git update"), + NULL +}; + +static struct option update_options[] = { + OPT_END() +}; + static int run_fetch(void) { struct strvec args = STRVEC_INIT; @@ -35,6 +45,8 @@ int cmd_update(int argc, const char **argv, const char *prefix) if (!getenv("GIT_REFLOG_ACTION")) setenv("GIT_REFLOG_ACTION", "update", 0); + argc = parse_options(argc, argv, prefix, update_options, update_usage, 0); + if (repo_read_index_unmerged(the_repository)) die_resolve_conflict("update"); -- 2.32.0.36.g70aac2b1aa