Merge branch 'pw/rebase-skip-commit-message-fix' into next

"git rebase -i" with a series of squash/fixup, when one of the
steps stopped in conflicts and ended up getting skipped, did not
handle the accumulated commit log messages, which has been
corrected.

* pw/rebase-skip-commit-message-fix:
  rebase --skip: fix commit message clean up when skipping squash
This commit is contained in:
Junio C Hamano
2023-08-06 17:15:11 -07:00
4 changed files with 94 additions and 40 deletions

View File

@ -1291,6 +1291,39 @@ test_cmp_rev () {
fi
}
# Tests that a commit message matches the expected text
#
# Usage: test_commit_message <rev> [-m <msg> | <file>]
#
# When using "-m" <msg> will have a line feed appended. If the second
# argument is omitted then the expected message is read from stdin.
test_commit_message () {
local msg_file=expect.msg
case $# in
3)
if test "$2" = "-m"
then
printf "%s\n" "$3" >"$msg_file"
else
BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
fi
;;
2)
msg_file="$2"
;;
1)
cat >"$msg_file"
;;
*)
BUG "Usage: test_commit_message <rev> [-m <message> | <file>]"
;;
esac
git show --no-patch --pretty=format:%B "$1" -- >actual.msg &&
test_cmp "$msg_file" actual.msg
}
# Compare paths respecting core.ignoreCase
test_cmp_fspath () {
if test "x$1" = "x$2"