From: Derrick Stolee <derrickstolee@xxxxxxxxxx> 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@xxxxxxxxxx> --- 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