]> git.ipfire.org Git - thirdparty/git.git/commit
am: fix signoff when other trailers are present
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 8 Aug 2017 10:25:33 +0000 (11:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Aug 2017 19:27:23 +0000 (12:27 -0700)
commit735285b403ee2b09c03d31f2dc8cc95a2d471ead
tree6c89845cd8826aa6904aae517f7963b57e073d6f
parentcf8899d285d2648013040ec7196ffd3de0606664
am: fix signoff when other trailers are present

If there was no 'Signed-off-by:' trailer but another trailer such as
'Reported-by:' then 'git am --signoff' would add a blank line between
the existing trailers and the added 'Signed-off-by:' line. e.g.

    Rebase accepts '--rerere-autoupdate' as an option but only honors
    it if '-m' is also given. Fix it for a non-interactive rebase by
    passing on the option to 'git am' and 'git cherry-pick'.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Fix by using the code provided for this purpose in sequencer.c.
Change the tests so that they check the formatting of the
'Signed-off-by:' lines rather than just grepping for them.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
t/t4150-am.sh