summaryrefslogtreecommitdiff
path: root/t/t9903-bash-prompt.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-02-23 23:39:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-28 20:57:51 (GMT)
commitd31f298f1a6c8503644d5b990fa864d7219bd27a (patch)
tree1e0e2ed224b2ceaf37627edd92ea9fe9b8d75e0a /t/t9903-bash-prompt.sh
parent91538d0cde9101599c0df0b7f01894edf0fd8e6b (diff)
downloadgit-d31f298f1a6c8503644d5b990fa864d7219bd27a.zip
git-d31f298f1a6c8503644d5b990fa864d7219bd27a.tar.gz
git-d31f298f1a6c8503644d5b990fa864d7219bd27a.tar.bz2
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 <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9903-bash-prompt.sh')
-rwxr-xr-xt/t9903-bash-prompt.sh14
1 files changed, 2 insertions, 12 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 97c9b32..8f5c811 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -735,22 +735,12 @@ test_expect_success 'prompt - hide if pwd ignored - env var set, config unset, p
test_cmp expected "$actual"
'
-test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stdout)' '
+test_expect_success 'prompt - hide if pwd ignored - inside gitdir' '
printf " (GIT_DIR!)" >expected &&
(
GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
cd .git &&
- __git_ps1 >"$actual" 2>/dev/null
- ) &&
- test_cmp expected "$actual"
-'
-
-test_expect_success 'prompt - hide if pwd ignored - inside gitdir (stderr)' '
- printf "" >expected &&
- (
- GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
- cd .git &&
- __git_ps1 >/dev/null 2>"$actual"
+ __git_ps1 >"$actual"
) &&
test_cmp expected "$actual"
'