summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-03-07 09:59:52 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-03-07 09:59:52 +0900
commit54b469b9e9a9f276a5980265cd2abeb003cb6bf3 (patch)
tree3f49a8bb58e9a36a00a3556990ae9e39e0815eaf /builtin/merge.c
parentMerge branch 'tg/checkout-no-overlay' (diff)
parentdiff.c: convert --raw (diff)
downloadtgif-54b469b9e9a9f276a5980265cd2abeb003cb6bf3.tar.xz
Merge branch 'nd/diff-parseopt'
The diff machinery, one of the oldest parts of the system, which long predates the parse-options API, uses fairly long and complex handcrafted option parser. This is being rewritten to use the parse-options API. * nd/diff-parseopt: diff.c: convert --raw diff.c: convert -W|--[no-]function-context diff.c: convert -U|--unified diff.c: convert -u|-p|--patch diff.c: prepare to use parse_options() for parsing diff.h: avoid bit fields in struct diff_flags diff.h: keep forward struct declarations sorted parse-options: allow ll_callback with OPTION_CALLBACK parse-options: avoid magic return codes parse-options: stop abusing 'callback' for lowlevel callbacks parse-options: add OPT_BITOP() parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN parse-options: add one-shot mode parse-options.h: remove extern on function prototypes
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index e47d77baee..5ce8946d39 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -113,12 +113,15 @@ static int option_parse_message(const struct option *opt,
return 0;
}
-static int option_read_message(struct parse_opt_ctx_t *ctx,
- const struct option *opt, int unset)
+static enum parse_opt_result option_read_message(struct parse_opt_ctx_t *ctx,
+ const struct option *opt,
+ const char *arg_not_used,
+ int unset)
{
struct strbuf *buf = opt->value;
const char *arg;
+ BUG_ON_OPT_ARG(arg_not_used);
if (unset)
BUG("-F cannot be negated");
@@ -262,7 +265,7 @@ static struct option builtin_merge_options[] = {
option_parse_message),
{ OPTION_LOWLEVEL_CALLBACK, 'F', "file", &merge_msg, N_("path"),
N_("read message from file"), PARSE_OPT_NONEG,
- (parse_opt_cb *) option_read_message },
+ NULL, 0, option_read_message },
OPT__VERBOSITY(&verbosity),
OPT_BOOL(0, "abort", &abort_current_merge,
N_("abort the current in-progress merge")),