]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/lib-rebase.sh
t3437: test script for fixup [-C|-c] options in interactive rebase
[thirdparty/git.git] / t / lib-rebase.sh
index b72c051f4761609246263c18f5e55a65f0ee9a8f..e10e38060b9c97c7bf89708c470659c17cf460b0 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.
@@ -33,6 +34,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
@@ -51,6 +53,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";;
                ">")