Skip to content

Commit 7e9e048

Browse files
moygitster
authored andcommitted
stash -p: demonstrate failure of split with mixed y/n
Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 798a5b0 commit 7e9e048

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

t/t3904-stash-patch.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,27 @@ test_expect_success 'none of this moved HEAD' '
8181
verify_saved_head
8282
'
8383

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+
84107
test_done

0 commit comments

Comments
 (0)