Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-02-12 16:29:41 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-12 22:58:21 +0300
commit45a2686441b0ea53ad9acef8b01dad2efdd98a90 (patch)
tree11478fa7550d182219a1cd47f6ed0dc8cd280eb4 /t/t6426-merge-skip-unneeded-updates.sh
parentebd73f50c680ca0984aae18fad7b821464ed2411 (diff)
test-lib-functions: remove bug-inducing "diagnostics" helper param
Remove the optional "diagnostics" parameter of the test_path_is_{file,dir,missing} functions. We have a lot of uses of these functions, but the only legitimate use of the diagnostics parameter is from when the functions themselves were introduced in 2caf20c52b7 (test-lib: user-friendly alternatives to test [-d|-f|-e], 2010-08-10). But as the the rest of this diff demonstrates its presence did more to silently introduce bugs in our tests. Fix such bugs in the tests added in ae4e89e549b (gc: add --keep-largest-pack option, 2018-04-15), and c04ba51739a (t6046: testcases checking whether updates can be skipped in a merge, 2018-04-19). Let's also assert that those functions are called with exactly one parameter, a follow-up commit will add similar asserts to other functions in test-lib-functions.sh that we didn't have existing misuse of. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6426-merge-skip-unneeded-updates.sh')
-rwxr-xr-xt/t6426-merge-skip-unneeded-updates.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index d7eeee4310..7b5f1c1dcd 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -492,7 +492,9 @@ test_expect_success '3a-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -522,7 +524,9 @@ test_expect_success '3a-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -588,7 +592,9 @@ test_expect_success '3b-L: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'
@@ -618,7 +624,9 @@ test_expect_success '3b-R: bq_1->foo/bq_2 on A, foo/->bar/ on B' '
test_cmp expect actual &&
test_must_fail git rev-parse HEAD:bq HEAD:foo/bq &&
- test_path_is_missing bq foo/bq foo/whatever
+ test_path_is_missing bq &&
+ test_path_is_missing foo/bq &&
+ test_path_is_missing foo/whatever
)
'