t3905: replace test -s with test_file_not_empty

In order to modernize the test script, replace `test -s` with
test_file_not_empty(), which provides better diagnostic output in the
case of failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Denton Liu 2021-02-08 23:28:51 -08:00 committed by Junio C Hamano
parent 389ece4022
commit 27e25a8cbf
1 changed files with 6 additions and 6 deletions

View File

@ -169,9 +169,9 @@ test_expect_success 'stash save --include-untracked respects .gitignore' '
mkdir ignored.d &&
echo ignored >ignored.d/untracked &&
git stash -u &&
test -s ignored &&
test -s ignored.d/untracked &&
test -s .gitignore
test_file_not_empty ignored &&
test_file_not_empty ignored.d/untracked &&
test_file_not_empty .gitignore
'

test_expect_success 'stash save -u can stash with only untracked files different' '
@ -189,9 +189,9 @@ test_expect_success 'stash save --all does not respect .gitignore' '

test_expect_success 'stash save --all is stash poppable' '
git stash pop &&
test -s ignored &&
test -s ignored.d/untracked &&
test -s .gitignore
test_file_not_empty ignored &&
test_file_not_empty ignored.d/untracked &&
test_file_not_empty .gitignore
'

test_expect_success 'stash push --include-untracked with pathspec' '