Skip to content
Snippets Groups Projects
Commit 79b04f9b authored by SZEDER Gábor's avatar SZEDER Gábor Committed by Junio C Hamano
Browse files

t3903-stash: don't try to grep non-existing file


The test 'store updates stash ref and reflog' in 't3903-stash.sh'
creates a stash from a new file, runs 'git reset --hard' to throw away
any modifications to the work tree, and then runs '! grep' to ensure
that the staged contents are gone.  Since the file didn't exist
before, it shouldn't exist after 'git reset' either.  Consequently,
this 'grep' doesn't fail as expected, because it can't find the staged
content, but it fails because it can't open the file.

Tighten this check by using 'test_path_is_missing' instead, thereby
avoiding an unexpected error from 'grep' as well.

Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 53f9a3e1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -724,7 +724,7 @@ test_expect_success 'store updates stash ref and reflog' '
git add bazzy &&
STASH_ID=$(git stash create) &&
git reset --hard &&
! grep quux bazzy &&
test_path_is_missing bazzy &&
git stash store -m quuxery $STASH_ID &&
test $(git rev-parse stash) = $STASH_ID &&
git reflog --format=%H stash| grep $STASH_ID &&
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment