bash prompt: use 'write_script' helper in interactive rebase test
authorSZEDER Gábor <szeder@ira.uka.de>
Fri, 24 Aug 2012 18:03:58 +0000 (20:03 +0200)
committerSZEDER Gábor <szeder@ira.uka.de>
Sun, 23 Jun 2013 23:50:42 +0000 (01:50 +0200)
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
t/t9903-bash-prompt.sh
index 7c7f8b974a012223a5bbf958cc0bc0be21213f62..442b9a20f57e1736710b7e63d43e1736c63c7504 100755 (executable)
@@ -248,14 +248,12 @@ test_expect_success 'prompt - inside bare repository' '
 
 test_expect_success 'prompt - interactive rebase' '
        printf " (b1|REBASE-i 2/3)" >expected
-       echo "#!$SHELL_PATH" >fake_editor.sh &&
-       cat >>fake_editor.sh <<\EOF &&
-echo "exec echo" >"$1"
-echo "edit $(git log -1 --format="%h")" >>"$1"
-echo "exec echo" >>"$1"
-EOF
+       write_script fake_editor.sh <<-\EOF &&
+               echo "exec echo" >"$1"
+               echo "edit $(git log -1 --format="%h")" >>"$1"
+               echo "exec echo" >>"$1"
+       EOF
        test_when_finished "rm -f fake_editor.sh" &&
-       chmod a+x fake_editor.sh &&
        test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
        git checkout b1 &&
        test_when_finished "git checkout master" &&