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

2 messages from 2017-11-22 to 2017-11-24. Participants: Phil Hord, Junio C Hamano.
Thread: https://gitlist.dev/t/47302

## Phil Hord, 2017-11-22 21:28

Subject: [PATCH v2 2/2] stash-store: add failing test for same-ref
Message-ID: <20171122212802.7068-1-phil.hord@gmail.com>
URL: https://gitlist.dev/e/20171122212802.7068-1-phil.hord%40gmail.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


```

## Junio C Hamano, 2017-11-24 05:49

Subject: Re: [PATCH v2 2/2] stash-store: add failing test for same-ref
Message-ID: <xmqqzi7cns4l.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqzi7cns4l.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <20171122212802.7068-1-phil.hord@gmail.com>

```
Phil Hord <phil.hord@gmail.com> writes:

> 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>
> ---

Sorry, I lost track.  Where is v1 of this series and 1/2 of v2?
IOW, where does this patch fit in in the larger picture?

>  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 &&

```
