Merge branch 'sa/t1011-use-helpers'

A GSoC practice.

* sa/t1011-use-helpers:
  t1011: replace test -f with test_path_is_file
This commit is contained in:
Junio C Hamano 2022-05-20 15:26:54 -07:00
Родитель 6b3d47a960 72315e431b
Коммит bdba04d4d0
1 изменённых файлов: 23 добавлений и 23 удалений

Просмотреть файл

@ -57,8 +57,8 @@ test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' '
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt result &&
test -f init.t &&
test -f sub/added
test_path_is_file init.t &&
test_path_is_file sub/added
'
test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse-checkout and enabled' '
@ -67,8 +67,8 @@ test_expect_success 'read-tree --no-sparse-checkout with empty .git/info/sparse-
read_tree_u_must_succeed --no-sparse-checkout -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt result &&
test -f init.t &&
test -f sub/added
test_path_is_file init.t &&
test_path_is_file sub/added
'
test_expect_success 'read-tree with empty .git/info/sparse-checkout' '
@ -85,8 +85,8 @@ test_expect_success 'read-tree with empty .git/info/sparse-checkout' '
S subsub/added
EOF
test_cmp expected.swt result &&
! test -f init.t &&
! test -f sub/added
test_path_is_missing init.t &&
test_path_is_missing sub/added
'
test_expect_success 'match directories with trailing slash' '
@ -101,8 +101,8 @@ test_expect_success 'match directories with trailing slash' '
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t > result &&
test_cmp expected.swt-noinit result &&
test ! -f init.t &&
test -f sub/added
test_path_is_missing init.t &&
test_path_is_file sub/added
'
test_expect_success 'match directories without trailing slash' '
@ -110,8 +110,8 @@ test_expect_success 'match directories without trailing slash' '
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt-noinit result &&
test ! -f init.t &&
test -f sub/added
test_path_is_missing init.t &&
test_path_is_file sub/added
'
test_expect_success 'match directories with negated patterns' '
@ -129,9 +129,9 @@ EOF
git read-tree -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt-negation result &&
test ! -f init.t &&
test ! -f sub/added &&
test -f sub/addedtoo
test_path_is_missing init.t &&
test_path_is_missing sub/added &&
test_path_is_file sub/addedtoo
'
test_expect_success 'match directories with negated patterns (2)' '
@ -150,9 +150,9 @@ EOF
git read-tree -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt-negation2 result &&
test -f init.t &&
test -f sub/added &&
test ! -f sub/addedtoo
test_path_is_file init.t &&
test_path_is_file sub/added &&
test_path_is_missing sub/addedtoo
'
test_expect_success 'match directory pattern' '
@ -160,8 +160,8 @@ test_expect_success 'match directory pattern' '
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt-noinit result &&
test ! -f init.t &&
test -f sub/added
test_path_is_missing init.t &&
test_path_is_file sub/added
'
test_expect_success 'checkout area changes' '
@ -176,15 +176,15 @@ test_expect_success 'checkout area changes' '
read_tree_u_must_succeed -m -u HEAD &&
git ls-files -t >result &&
test_cmp expected.swt-nosub result &&
test -f init.t &&
test ! -f sub/added
test_path_is_file init.t &&
test_path_is_missing sub/added
'
test_expect_success 'read-tree updates worktree, absent case' '
echo sub/added >.git/info/sparse-checkout &&
git checkout -f top &&
read_tree_u_must_succeed -m -u HEAD^ &&
test ! -f init.t
test_path_is_missing init.t
'
test_expect_success 'read-tree will not throw away dirty changes, non-sparse' '
@ -229,7 +229,7 @@ test_expect_success 'read-tree adds to worktree, absent case' '
echo init.t >.git/info/sparse-checkout &&
git checkout -f removed &&
read_tree_u_must_succeed -u -m HEAD^ &&
test ! -f sub/added
test_path_is_missing sub/added
'
test_expect_success 'read-tree adds to worktree, dirty case' '
@ -248,7 +248,7 @@ test_expect_success 'index removal and worktree narrowing at the same time' '
echo init.t >.git/info/sparse-checkout &&
git checkout removed &&
git ls-files sub/added >result &&
test ! -f sub/added &&
test_path_is_missing sub/added &&
test_must_be_empty result
'