git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Apr 14, 2015, 11:32 UTC
Message-ID
<1429011168-23216-5-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<1429011168-23216-1-git-send-email-Matthieu.Moy@imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@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 2>error &&
+	! test_must_be_empty error &&
+	grep "added line 1" test &&
+	! grep "added line 2" test
+'
+
 test_done
-- 
2.4.0.rc1.42.g9642cc6
Previous: Matthieu MoyNext: Eric Sunshine
Message 8 of 17 in “Git add -p “Your edited hunk does not apply. Edit again””
  1. Tanky WooApr 14, 2015
  2. Matthieu MoyApr 14, 2015
  3. 0/4 demonstrate add -p and stash -p failures.Matthieu Moy, Apr 14, 2015
  4. 1/4 add -p: demonstrate failure when running 'edit' after a splitMatthieu Moy, Apr 14, 2015
  5. Eric SunshineApr 14, 2015
  6. 2/4 t3904-stash-patch: fix test descriptionMatthieu Moy, Apr 14, 2015
  7. 3/4 t3904-stash-patch: factor PERL prereq at the top of the fileMatthieu Moy, Apr 14, 2015
  8. 4/4 stash -p: demonstrate failure of split with mixed y/nMatthieu Moy, Apr 14, 2015
  9. Eric SunshineApr 14, 2015
  10. Junio C HamanoApr 14, 2015
  11. 0/5 demonstrate add -p and stash -p failuresMatthieu Moy, Apr 16, 2015
  12. 1/5 t3701-add-interactive: simplify codeMatthieu Moy, Apr 16, 2015
  13. 2/5 add -p: demonstrate failure when running 'edit' after a splitMatthieu Moy, Apr 16, 2015
  14. 3/5 t3904-stash-patch: fix test descriptionMatthieu Moy, Apr 16, 2015
  15. 4/5 t3904-stash-patch: factor PERL prereq at the top of the fileMatthieu Moy, Apr 16, 2015
  16. 5/5 stash -p: demonstrate failure of split with mixed y/nMatthieu Moy, Apr 16, 2015
  17. Matthieu MoyApr 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.