[PATCH v5 13/29] rebase: skip stripping of --trailer option prefix

Li Chen
2025-10-22T05:42:31Z

Removed redundant --trailer= prefix stripping in
validate_trailer_args_after_config() since OPT_STRVEC
already stores only the argument text.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
builtin/rebase.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/builtin/rebase.c b/builtin/rebase.c
index a950005dfc..3ac1eda61b 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1128,13 +1128,9 @@ static int validate_trailer_args_after_config(const struct strvec *cli_args,
struct strbuf *err)
{
for (size_t i = 0; i < cli_args->nr; i++) {
- const char *raw = cli_args->v[i];
- const char *txt; // Key[:=]Val
+ const char *txt = cli_args->v[i]; // Key[:=]Val
const char *sep;

- if (!skip_prefix(raw, "--trailer=", &txt))
- txt = raw;
-
if (!*txt) {
strbuf_addstr(err, _("empty --trailer argument"));
return -1;
--
2.51.0