Skip to content

Commit ed25471

Browse files
rscharfegitster
authored andcommitted
test: use test_must_be_empty F instead of test_cmp empty F
Use test_must_be_empty instead of comparing it to an empty file. That's more efficient, as the function only needs built-in meta-data only check in the usual case, and provides nicer debug output otherwise. Helped-by: Denton Liu <[email protected]> Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 213dabf commit ed25471

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

t/t1011-read-tree-sparse-checkout.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,14 @@ test_expect_success 'read-tree adds to worktree, dirty case' '
215215
'
216216

217217
test_expect_success 'index removal and worktree narrowing at the same time' '
218-
>empty &&
219218
echo init.t >.git/info/sparse-checkout &&
220219
echo sub/added >>.git/info/sparse-checkout &&
221220
git checkout -f top &&
222221
echo init.t >.git/info/sparse-checkout &&
223222
git checkout removed &&
224223
git ls-files sub/added >result &&
225224
test ! -f sub/added &&
226-
test_cmp empty result
225+
test_must_be_empty result
227226
'
228227

229228
test_expect_success 'read-tree --reset removes outside worktree' '

t/t9010-svn-fe.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ text_no_props () {
5353
printf "%s\n" "$text"
5454
}
5555

56-
>empty
57-
5856
test_expect_success 'empty dump' '
5957
reinit_git &&
6058
echo "SVN-fs-dump-format-version: 2" >input &&
@@ -208,7 +206,7 @@ test_expect_failure 'timestamp and empty file' '
208206
test_cmp expect.date actual.date &&
209207
test_cmp expect.files actual.files &&
210208
git checkout HEAD empty-file &&
211-
test_cmp empty file
209+
test_must_be_empty file
212210
'
213211

214212
test_expect_success 'directory with files' '

0 commit comments

Comments
 (0)