From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Johannes.Schindelin@gmx.de, ps@pks.im,
james@jamesliu.io, Derrick Stolee <stolee@gmail.com>,
Derrick Stolee <derrickstolee@github.com>
Subject: [PATCH 6/7] t7508/12: set GIT_ADVICE=1 across all tests
Date: Wed, 21 Aug 2024 11:02:31 +0000 [thread overview]
Message-ID: <960d1ec11ece90a29da8a909243aeeca0fdc04fb.1724238153.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1776.git.1724238152.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>
The output of 'git status' changes depending on the availability of advice,
even though the messages are to stdout. Since this test script is all about
testing the output of 'git status' including the existence (or lack of)
these messages, set the GIT_ADVICE environment globally across the script.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
t/t7508-status.sh | 4 ++++
t/t7512-status-help.sh | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 773383fefb5..7158ee57f37 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -9,6 +9,10 @@ TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
+# 'git status' output changes depending on the availability of advice,
+# so force its output to enable advice, even though it goes to stdout.
+GIT_ADVICE=1 && export GIT_ADVICE
+
test_expect_success 'status -h in broken repository' '
git config --global advice.statusuoption false &&
mkdir broken &&
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index de277257d50..1d9676bb3e2 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -17,6 +17,10 @@ TEST_PASSES_SANITIZE_LEAK=true
set_fake_editor
+# 'git status' output changes depending on the availability of advice,
+# so force its output to enable advice, even though it goes to stdout.
+GIT_ADVICE=1 && export GIT_ADVICE
+
test_expect_success 'prepare for conflicts' '
git config --global advice.statusuoption false &&
test_commit init main.txt init &&
--
gitgitgadget
next prev parent reply other threads:[~2024-08-21 11:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 11:02 [PATCH 0/7] [RFC] advice: refuse to output if stderr not TTY Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` [PATCH 1/7] t1000-2000: add GIT_ADVICE=1 for advice tests Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` [PATCH 2/7] t3000-4000: add GIT_ADVICE=1 to " Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` [PATCH 3/7] t5000: " Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` [PATCH 4/7] t6000: " Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` [PATCH 5/7] t7000: " Derrick Stolee via GitGitGadget
2024-08-21 11:02 ` Derrick Stolee via GitGitGadget [this message]
2024-08-21 11:02 ` [PATCH 7/7] advice: refuse to output if stderr not TTY Derrick Stolee via GitGitGadget
2024-08-21 15:40 ` [PATCH 0/7] [RFC] " Jeff King
2024-08-21 16:39 ` Junio C Hamano
2024-08-21 16:36 ` Junio C Hamano
2024-08-22 6:19 ` Patrick Steinhardt
2024-08-22 6:03 ` Gabor Gombas
2024-08-22 13:15 ` Derrick Stolee
2024-08-22 16:25 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=960d1ec11ece90a29da8a909243aeeca0fdc04fb.1724238153.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=james@jamesliu.io \
--cc=ps@pks.im \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).