aboutsummaryrefslogtreecommitdiffstats
path: root/t/t4060-diff-submodule-option-diff-format.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-06-02 08:44:42 +0200
committerJunio C Hamano <gitster@pobox.com>2025-06-02 07:51:42 -0700
commitddfcb9d466a4f4eab6c5bd578c9b13263d4ba610 (patch)
tree68b5dd0835f83da6c6753887e106539b05ae78d1 /t/t4060-diff-submodule-option-diff-format.sh
parentt: stop announcing prereqs (diff)
downloadgit-ddfcb9d466a4f4eab6c5bd578c9b13263d4ba610.tar.gz
git-ddfcb9d466a4f4eab6c5bd578c9b13263d4ba610.zip
t: silence output from `test_create_repo()`
There are a couple users of `test_create_repo()` that use this function outside of any test case. This function is nowadays only a thin wrapper around `git init`, which by default prints a message to stdout that the repository has been initialized. The resulting output may thus confuse TAP parsers. Refactor these users to instead create the repository in a "setup" test case so that we don't explicitly have to silence them. There's one exception in t1007: we use `push_repo()` and its `pop_repo()` equivalent multiple times, so to reduce the noise introduced by this patch we instead silence this invocation. While at it, convert callsites to use git-init(1) directly as the `test_create_repo()` function has been deprecated in f0d4d398e28 (test-lib: split up and deprecate test_create_repo(), 2021-05-10). Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4060-diff-submodule-option-diff-format.sh')
-rwxr-xr-xt/t4060-diff-submodule-option-diff-format.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh
index 76b83101d3..dbfeb7470b 100755
--- a/t/t4060-diff-submodule-option-diff-format.sh
+++ b/t/t4060-diff-submodule-option-diff-format.sh
@@ -363,9 +363,12 @@ test_expect_success 'typechanged submodule(submodule->blob)' '
diff_cmp expected actual
'
-rm -f sm1 &&
-test_create_repo sm1 &&
-head6=$(add_file sm1 foo6 foo7)
+test_expect_success 'setup' '
+ rm -f sm1 &&
+ git init sm1 &&
+ head6=$(add_file sm1 foo6 foo7)
+'
+
test_expect_success 'nonexistent commit' '
git diff-index -p --submodule=diff HEAD >actual &&
cat >expected <<-EOF &&