Skip to content

Commit b7cc705

Browse files
Oblomovgitster
authored andcommitted
builtin/am: honor --signoff also when --rebasing
Signoff is handled in parse_mail(), but not in parse_mail_rebasing(), since the latter is only used when git-rebase calls git-am with the --rebasing option, and --signoff is never passed in this case. In order to introduce (in the upcoming commits) support for `git-rebase --signoff`, we must make git-am pay attention to it also in the rebase case. This can be done by moving the conditional addition of the signoff from parse_mail() to the caller am_run(), after either of the parse_mail*() functions were called. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ad36dc8 commit b7cc705

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

builtin/am.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,6 @@ static int parse_mail(struct am_state *state, const char *mail)
13211321
strbuf_addbuf(&msg, &mi.log_message);
13221322
strbuf_stripspace(&msg, 0);
13231323

1324-
if (state->signoff)
1325-
am_signoff(&msg);
1326-
13271324
assert(!state->author_name);
13281325
state->author_name = strbuf_detach(&author_name, NULL);
13291326

@@ -1848,6 +1845,9 @@ static void am_run(struct am_state *state, int resume)
18481845
if (skip)
18491846
goto next; /* mail should be skipped */
18501847

1848+
if (state->signoff)
1849+
am_append_signoff(state);
1850+
18511851
write_author_script(state);
18521852
write_commit_msg(state);
18531853
}

0 commit comments

Comments
 (0)