stash -p: demonstrate failure of split with mixed y/n

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matthieu Moy committed Apr 16, 2015 at 09:02 UTC 7e9e048661477ad17f57a7153eaaec490660e767
1 file changed +23
t/t3904-stash-patch.sh
+23
@@ -81,4 +81,27 @@ test_expect_success 'none of this moved HEAD' '
81 verify_saved_head
82 '
83
84 +test_expect_failure 'stash -p with split hunk' '
85 + git reset --hard &&
86 + cat >test <<-\EOF &&
87 + aaa
88 + bbb
89 + ccc
90 + EOF
91 + git add test &&
92 + git commit -m "initial" &&
93 + cat >test <<-\EOF &&
94 + aaa
95 + added line 1
96 + bbb
97 + added line 2
98 + ccc
99 + EOF
100 + printf "%s\n" s n y q |
101 + test_might_fail git stash -p 2>error &&
102 + ! test_must_be_empty error &&
103 + grep "added line 1" test &&
104 + ! grep "added line 2" test
105 +'
106 +
107 test_done