]> source.dussan.org Git - jgit.git/commit
RebaseCommand: fix commit message in "fixup" case 28/189728/4
authorThomas Wolf <thomas.wolf@paranor.ch>
Mon, 17 Jan 2022 23:37:33 +0000 (00:37 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 2 Feb 2022 13:40:58 +0000 (14:40 +0100)
commit035d24097dacc88c54be6349234feeda7447c372
tree76261860d9fbf6caeb16730f5d1c4f81e950c096
parent92158af52e3c438ecfef3cf3fab2126b1f77cd75
RebaseCommand: fix commit message in "fixup" case

JGit accumulated in MESSAGE_FIXUP commit messages of a fixup sequence,
just like it did in MESSAGE_SQUASH, and on the last step of a sequence
of fixups used that file, after stripping all comment lines, as the
commit message. That also stripped any lines from the original commit
message that happened to start with the comment character.

This is not how this is supposed to work. MESSAGE_FIXUP must contain
the original commit message of the base commit that is amended, and
the file contains the verbatim commit message for the final fixup.[1]

Change the implementation accordingly, and add new tests.

[1] https://github.com/git/git/blob/df3c41adeb/sequencer.c#L86 ff.

Bug: 513726
Change-Id: I885a2b7f10d6c74460a8693aa6cbf867ee0494a1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java