[PATCH 4/4] stash -p: demonstrate failure of split with mixed y/n

2015-04-14 Thread Matthieu Moy
Signed-off-by: Matthieu Moy matthieu@imag.fr
---
 t/t3904-stash-patch.sh | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh
index 0f8f47f..6f053ff 100755
--- a/t/t3904-stash-patch.sh
+++ b/t/t3904-stash-patch.sh
@@ -81,4 +81,30 @@ test_expect_success 'none of this moved HEAD' '
verify_saved_head
 '
 
+test_expect_failure 'stash -p with split hunk' '
+   git reset --hard 
+   cat test -\EOF 
+   aaa
+   bbb
+   ccc
+   EOF
+   git add test 
+   git commit -m initial 
+   cat test -\EOF 
+   aaa
+   added line 1
+   bbb
+   added line 2
+   ccc
+   EOF
+   for a in s n y q
+   do
+   echo $a
+   done |
+   test_might_fail git stash -p 2error 
+   ! test_must_be_empty error 
+   grep added line 1 test 
+   ! grep added line 2 test
+'
+
 test_done
-- 
2.4.0.rc1.42.g9642cc6

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] stash -p: demonstrate failure of split with mixed y/n

2015-04-14 Thread Eric Sunshine
On Tue, Apr 14, 2015 at 7:32 AM, Matthieu Moy matthieu@imag.fr wrote:
 Signed-off-by: Matthieu Moy matthieu@imag.fr
 ---
 diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh
 index 0f8f47f..6f053ff 100755
 --- a/t/t3904-stash-patch.sh
 +++ b/t/t3904-stash-patch.sh
 @@ -81,4 +81,30 @@ test_expect_success 'none of this moved HEAD' '
 verify_saved_head
  '

 +test_expect_failure 'stash -p with split hunk' '
 +   git reset --hard 
 +   cat test -\EOF 
 +   aaa
 +   bbb
 +   ccc
 +   EOF
 +   git add test 
 +   git commit -m initial 
 +   cat test -\EOF 
 +   aaa
 +   added line 1
 +   bbb
 +   added line 2
 +   ccc
 +   EOF
 +   for a in s n y q
 +   do
 +   echo $a
 +   done |

Simplified:

printf '%s\n' s n y q |

 +   test_might_fail git stash -p 2error 
 +   ! test_must_be_empty error 
 +   grep added line 1 test 
 +   ! grep added line 2 test
 +'
 +
  test_done
 --
 2.4.0.rc1.42.g9642cc6
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html