Skip to content

Commit b126b65

Browse files
committed
test: do not negate test_path_is_* to assert absense
These tests use "! test_path_is_dir" or "! test_path_is_file" to ensure that the path is not recursively checked out or "submodule update" did not touch the working tree. Use "test_path_is_missing" to assert that the path does not exist, instead of negating test_path_is_* helpers; they are designed to be loud in wrong occasions. Besides, negating "test_path_is_dir" would mean we would be happy if a file exists there, which is not the case for these tests. Signed-off-by: Junio C Hamano <[email protected]>
1 parent eab648d commit b126b65

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

t/lib-submodule-update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ test_submodule_recursing_with_args_common () {
802802
git branch -t no_submodule origin/no_submodule &&
803803
$command no_submodule &&
804804
test_superproject_content origin/no_submodule &&
805-
! test_path_is_dir sub1 &&
805+
test_path_is_missing sub1 &&
806806
test_must_fail git config -f .git/modules/sub1/config core.worktree &&
807807
test_must_fail git config -f .git/modules/sub1/modules/sub2/config core.worktree
808808
)

t/t5572-pull-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ test_expect_success "fetch.recurseSubmodules option triggers recursive fetch (bu
121121
sub_oid=$(git -C child rev-parse HEAD) &&
122122
git -C super/sub cat-file -e $sub_oid &&
123123
# Check that the submodule worktree did not update
124-
! test_path_is_file super/sub/merge_strategy_5.t
124+
test_path_is_missing super/sub/merge_strategy_5.t
125125
'
126126

127127
test_expect_success "fetch.recurseSubmodules takes precedence over submodule.recurse" '
@@ -134,7 +134,7 @@ test_expect_success "fetch.recurseSubmodules takes precedence over submodule.rec
134134
sub_oid=$(git -C child rev-parse HEAD) &&
135135
git -C super/sub cat-file -e $sub_oid &&
136136
# Check that the submodule worktree did not update
137-
! test_path_is_file super/sub/merge_strategy_6.t
137+
test_path_is_missing super/sub/merge_strategy_6.t
138138
'
139139

140140
test_expect_success 'pull --rebase --recurse-submodules (remote superproject submodule changes, local submodule changes)' '

0 commit comments

Comments
 (0)