Imported Upstream version 2.20.4
[platform/upstream/git.git] / t / t3904-stash-patch.sh
index 83744f8..9546b6f 100755 (executable)
@@ -29,14 +29,14 @@ test_expect_success 'setup' '
 test_expect_success 'saying "n" does nothing' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state dir/foo work index &&
-       (echo n; echo n; echo n) | test_must_fail git stash save -p &&
+       test_write_lines n n n | test_must_fail git stash save -p &&
        verify_state HEAD HEADfile_work HEADfile_index &&
        verify_saved_state bar &&
        verify_state dir/foo work index
 '
 
 test_expect_success 'git stash -p' '
-       (echo y; echo n; echo y) | git stash save -p &&
+       test_write_lines y n y | git stash save -p &&
        verify_state HEAD committed HEADfile_index &&
        verify_saved_state bar &&
        verify_state dir/foo head index &&
@@ -51,7 +51,7 @@ test_expect_success 'git stash -p --no-keep-index' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state bar bar_work bar_index &&
        set_state dir/foo work index &&
-       (echo y; echo n; echo y) | git stash save -p --no-keep-index &&
+       test_write_lines y n y | git stash save -p --no-keep-index &&
        verify_state HEAD committed committed &&
        verify_state bar bar_work dummy &&
        verify_state dir/foo head head &&
@@ -66,7 +66,7 @@ test_expect_success 'git stash --no-keep-index -p' '
        set_state HEAD HEADfile_work HEADfile_index &&
        set_state bar bar_work bar_index &&
        set_state dir/foo work index &&
-       (echo y; echo n; echo y) | git stash save --no-keep-index -p &&
+       test_write_lines y n y | git stash save --no-keep-index -p &&
        verify_state HEAD committed committed &&
        verify_state dir/foo head head &&
        verify_state bar bar_work dummy &&