Skip to content

Commit 79b04f9

Browse files
szedergitster
authored andcommitted
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: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit 79b04f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t3903-stash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ test_expect_success 'store updates stash ref and reflog' '
724724
git add bazzy &&
725725
STASH_ID=$(git stash create) &&
726726
git reset --hard &&
727-
! grep quux bazzy &&
727+
test_path_is_missing bazzy &&
728728
git stash store -m quuxery $STASH_ID &&
729729
test $(git rev-parse stash) = $STASH_ID &&
730730
git reflog --format=%H stash| grep $STASH_ID &&

0 commit comments

Comments
 (0)