Skip to content

Commit d31f298

Browse files
szedergitster
authored andcommitted
t9903-bash-prompt: don't check the stderr of __git_ps1()
A test in 't9903-bash-prompt.sh' fails when the test script is run with '-x' tracing and a Bash version not yet supporting BASH_XTRACEFD, notably the default Bash version shipped in OSX. The reason for the failure is that the test checks the emptiness of __git_ps1()'s stderr, which includes the trace of all commands executed within __git_ps1() as well, throwing off the emptiness check. Having only a single test checking the empty stderr doesn't bring us much when none of the other tests do so, so remove this test for now. After this change t9903 passes with '-x', even when running with a Bash version not yet supporing BASH_XTRACEFD. In the future we might want to consider checking the emptiness of __git_ps1()'s stderr in each and every test, in which case we'd have to mark this test script as 'test_untraceable', but that's a different topic. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 91538d0 commit d31f298

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

t/t9903-bash-prompt.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -735,22 +735,12 @@ test_expect_success 'prompt - hide if pwd ignored - env var set, config unset, p
735735
test_cmp expected "$actual"
736736
'
737737

738-
test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stdout)' '
738+
test_expect_success 'prompt - hide if pwd ignored - inside gitdir' '
739739
printf " (GIT_DIR!)" >expected &&
740740
(
741741
GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
742742
cd .git &&
743-
__git_ps1 >"$actual" 2>/dev/null
744-
) &&
745-
test_cmp expected "$actual"
746-
'
747-
748-
test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stderr)' '
749-
printf "" >expected &&
750-
(
751-
GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
752-
cd .git &&
753-
__git_ps1 >/dev/null 2>"$actual"
743+
__git_ps1 >"$actual"
754744
) &&
755745
test_cmp expected "$actual"
756746
'

0 commit comments

Comments
 (0)