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

[PATCH 1/3] stash: add test for stash create with no files

From
Joel Teichroeb <joel@teichroeb.net>
Date
Aug 19, 2017, 20:13 UTC
Message-ID
<20170819201326.6872-1-joel@teichroeb.net>
Ensure the command suceeds and outputs nothing
Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
---
 t/t3903-stash.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 4046817d70..f0708ced27 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -444,6 +444,14 @@ test_expect_failure 'stash file to directory' '
 	test foo = "$(cat file/file)"
 '
 
+test_expect_success 'stash create - no changes' '
+	git stash clear &&
+	test_when_finished "git reset --hard HEAD" &&
+	git reset --hard &&
+	git stash create >actual &&
+	test_must_be_empty actual
+'
+
 test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
 	git stash clear &&
 	test_when_finished "git reset --hard HEAD" &&
-- 
2.14.1
Next: Joel Teichroeb
Message 1 of 6 in “stash: add test for stash create with no files”
  1. 1/3 stash: add test for stash create with no filesJoel Teichroeb, Aug 19, 2017
  2. 2/3 stash: Add a test for when apply fails during stash branchJoel Teichroeb, Aug 19, 2017
  3. 3/3 stash: add test for stashing in a detached stateJoel Teichroeb, Aug 19, 2017
  4. Junio C HamanoAug 19, 2017
  5. Joel TeichroebAug 19, 2017
  6. Junio C HamanoAug 19, 2017

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.