summaryrefslogtreecommitdiff
path: root/builtin/tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:53 (GMT)
commitab96f28ba4deb71ff64b31bd63cee96314db7112 (patch)
tree16ad5cafd201b65eb74c0c132f08b5ecc852fd92 /builtin/tag.c
parentfa2f2f085ed8999b799d48e652f9e438571e8491 (diff)
parent61b0fcbb64d00d52290d433c1e754c01740b3d19 (diff)
downloadgit-ab96f28ba4deb71ff64b31bd63cee96314db7112.zip
git-ab96f28ba4deb71ff64b31bd63cee96314db7112.tar.gz
git-ab96f28ba4deb71ff64b31bd63cee96314db7112.tar.bz2
Merge branch 'jk/unused-parameter-fixes'
Various functions have been audited for "-Wunused-parameter" warnings and bugs in them got fixed. * jk/unused-parameter-fixes: midx: double-check large object write loop assert NOARG/NONEG behavior of parse-options callbacks parse-options: drop OPT_DATE() apply: return -1 from option callback instead of calling exit(1) cat-file: report an error on multiple --batch options tag: mark "--message" option with NONEG show-branch: mark --reflog option as NONEG format-patch: mark "--no-numbered" option with NONEG status: mark --find-renames option with NONEG cat-file: mark batch options with NONEG pack-objects: mark index-version option as NONEG ls-files: mark exclude options as NONEG am: handle --no-patch-format option apply: mark include/exclude options as NONEG
Diffstat (limited to 'builtin/tag.c')
-rw-r--r--builtin/tag.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index f623632..02f6bd1 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -338,6 +338,8 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
{
struct msg_arg *msg = opt->value;
+ BUG_ON_OPT_NEG(unset);
+
if (!arg)
return -1;
if (msg->buf.len)
@@ -390,8 +392,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
OPT_GROUP(N_("Tag creation options")),
OPT_BOOL('a', "annotate", &annotate,
N_("annotated tag, needs a message")),
- OPT_CALLBACK('m', "message", &msg, N_("message"),
- N_("tag message"), parse_msg_arg),
+ { OPTION_CALLBACK, 'm', "message", &msg, N_("message"),
+ N_("tag message"), PARSE_OPT_NONEG, parse_msg_arg },
OPT_FILENAME('F', "file", &msgfile, N_("read message from file")),
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of tag message")),
OPT_BOOL('s', "sign", &opt.sign, N_("annotated and GPG-signed tag")),