aboutsummaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLi Chen <me@linux.beauty>2026-03-06 14:53:31 +0000
committerJunio C Hamano <gitster@pobox.com>2026-03-06 13:02:20 -0800
commit5e148696bf86f0173dfc91571d15ba833ec19ccd (patch)
tree63c53c41184137472ef8fe360a14f66100552e61 /builtin/commit.c
parent6b2243fdd45f0596fc640823faaa6a1aec05a420 (diff)
downloadgit-5e148696bf86f0173dfc91571d15ba833ec19ccd.tar.xz
commit, tag: parse --trailer with OPT_STRVEC
Now that amend_file_with_trailers() expects raw trailer lines, do not store argv-style "--trailer=<trailer>" strings in git commit and git tag. Parse --trailer using OPT_STRVEC so trailer_args contains only the trailer value, and drop the temporary prefix stripping in amend_file_with_trailers(). Signed-off-by: Li Chen <me@linux.beauty> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index eb9013995c..3d25c1856c 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1720,7 +1720,8 @@ int cmd_commit(int argc,
OPT_STRING(0, "fixup", &fixup_message, N_("[(amend|reword):]commit"), N_("use autosquash formatted message to fixup or amend/reword specified commit")),
OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")),
OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")),
- OPT_PASSTHRU_ARGV(0, "trailer", &trailer_args, N_("trailer"), N_("add custom trailer(s)"), PARSE_OPT_NONEG),
+ OPT_STRVEC(0, "trailer", &trailer_args, N_("trailer"),
+ N_("add custom trailer(s)")),
OPT_BOOL('s', "signoff", &signoff, N_("add a Signed-off-by trailer")),
OPT_FILENAME('t', "template", &template_file, N_("use specified template file")),
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),