diff options
Diffstat (limited to 't/lib-rebase.sh')
-rw-r--r-- | t/lib-rebase.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index ec6b9b1..b575413 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -207,3 +207,18 @@ check_reworded_commits () { >reword-log && test_cmp reword-expected reword-log } + +# usage: set_replace_editor <file> +# +# Replace the todo file with the exact contents of the given file. +set_replace_editor () { + cat >script <<-\EOF && + cat FILENAME >"$1" + + echo 'rebase -i script after editing:' + cat "$1" + EOF + + sed -e "s/FILENAME/$1/g" <script | write_script fake-editor.sh && + test_set_editor "$(pwd)/fake-editor.sh" +} |