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

[PATCH v2 2/2] stash-store: add failing test for same-ref

From
Phil Hord <phil.hord@gmail.com>
Date
Nov 22, 2017, 21:28 UTC
Message-ID
<20171122212802.7068-1-phil.hord@gmail.com>

stash-store cannot create a new stash with the same ref as stash@{0}. No error is returned even though no new stash log is created. Add a failing test to track.

Signed-off-by: Phil Hord <phil.hord@gmail.com>
---
 t/t3903-stash.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 279e31717..7d511afd3 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -813,6 +813,17 @@ test_expect_success 'push -m also works without space' '
 	test_cmp expect actual
 '
 
+test_expect_failure 'store same ref twice' '
+	>foo &&
+	git add foo &&
+	STASH_ID=$(git stash create) &&
+	git stash store -m "original message" $STASH_ID &&
+	git stash store -m "custom message" $STASH_ID &&
+	echo "stash@{0}: custom message" >expect &&
+	git stash list -1 >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success 'store -m foo shows right message' '
 	>foo &&
 	git add foo &&
-- 
2.15.0.471.g17a719cfe.dirty
Next: Junio C Hamano
Message 1 of 2 in “stash-store: add failing test for same-ref”
  1. 2/2 stash-store: add failing test for same-refPhil Hord, Nov 22, 2017
  2. Junio C HamanoNov 24, 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.