bash prompt: use 'write_script' helper in interactive rebase test
Helped-by: Jeff King <peff@peff.net> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
SZEDER Gábor committed
Aug 24, 2012 at 20:03 UTC
7412290cc4b5aa0efc205f81e4775dd7df9ea9d5
1 file changed
+5
-7
t/t9903-bash-prompt.sh
+5
-7
@@ -248,14 +248,12 @@ test_expect_success 'prompt - inside bare repository' '
248
249
test_expect_success 'prompt - interactive rebase' '
250
printf " (b1|REBASE-i 2/3)" >expected
251
- echo "#!$SHELL_PATH" >fake_editor.sh &&
252
- cat >>fake_editor.sh <<\EOF &&
253
-echo "exec echo" >"$1"
254
-echo "edit $(git log -1 --format="%h")" >>"$1"
255
-echo "exec echo" >>"$1"
256
-EOF
251
+ write_script fake_editor.sh <<-\EOF &&
252
+ echo "exec echo" >"$1"
253
+ echo "edit $(git log -1 --format="%h")" >>"$1"
254
+ echo "exec echo" >>"$1"
255
+ EOF
256
test_when_finished "rm -f fake_editor.sh" &&
258
- chmod a+x fake_editor.sh &&
257
test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" &&
258
git checkout b1 &&
259
test_when_finished "git checkout master" &&