Replace instances of "! test -f <file>" with "test_path_is_missing <file>".
This macro provides better diagnostics when the test fails (it prints
"Path exists:" instead of silently failing).
Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git ls-files -s &&
read_tree_u_must_succeed --reset -u HEAD &&
git ls-files -s >actual &&
- ! test -f old &&
+ test_path_is_missing old &&
test_cmp expect actual
'
git ls-files -s &&
read_tree_u_must_succeed --reset -u HEAD HEAD &&
git ls-files -s >actual &&
- ! test -f old &&
+ test_path_is_missing old &&
test_cmp expect actual
'
git ls-files -s &&
git reset --hard &&
git ls-files -s >actual &&
- ! test -f old &&
+ test_path_is_missing old &&
test_cmp expect actual
'
git ls-files -s &&
git checkout -f &&
git ls-files -s >actual &&
- ! test -f old &&
+ test_path_is_missing old &&
test_cmp expect actual
'
git ls-files -s &&
git checkout -f HEAD &&
git ls-files -s >actual &&
- ! test -f old &&
+ test_path_is_missing old &&
test_cmp expect actual
'