]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/lib-rebase.sh
Merge branch 'cm/rebase-i'
[thirdparty/git.git] / t / lib-rebase.sh
index 172d7459ff09b7e619101e2f88e951babea0e9ce..27928ecb94c32f779e3d450f5b9a652fe830f919 100644 (file)
@@ -4,6 +4,7 @@
 #
 # - override the commit message with $FAKE_COMMIT_MESSAGE
 # - amend the commit message with $FAKE_COMMIT_AMEND
+# - copy the original commit message to a file with $FAKE_MESSAGE_COPY
 # - check that non-commit messages have a certain line count with $EXPECT_COUNT
 # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
 # - rewrite a rebase -i script as directed by $FAKE_LINES.
@@ -32,6 +33,7 @@ set_fake_editor () {
                        exit
                test -z "$FAKE_COMMIT_MESSAGE" || echo "$FAKE_COMMIT_MESSAGE" > "$1"
                test -z "$FAKE_COMMIT_AMEND" || echo "$FAKE_COMMIT_AMEND" >> "$1"
+               test -z "$FAKE_MESSAGE_COPY" || cat "$1" >"$FAKE_MESSAGE_COPY"
                exit
                ;;
        esac
@@ -50,6 +52,8 @@ set_fake_editor () {
                        action="$line";;
                exec_*|x_*|break|b)
                        echo "$line" | sed 's/_/ /g' >> "$1";;
+               merge_*|fixup_*)
+                       action=$(echo "$line" | sed 's/_/ /g');;
                "#")
                        echo '# comment' >> "$1";;
                ">")