diff options
Diffstat (limited to 't/t9903-bash-prompt.sh')
-rwxr-xr-x | t/t9903-bash-prompt.sh | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 97c9b32c2e..ab890d3d4b 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @@ -63,18 +63,15 @@ test_expect_success 'prompt - unborn branch' ' test_cmp expected "$actual" ' -repo_with_newline='repo -with -newline' - -if test_have_prereq !MINGW && mkdir "$repo_with_newline" 2>/dev/null -then - test_set_prereq FUNNYNAMES -else +if test_have_prereq !FUNNYNAMES; then say 'Your filesystem does not allow newlines in filenames.' fi test_expect_success FUNNYNAMES 'prompt - with newline in path' ' + repo_with_newline="repo +with +newline" && + mkdir "$repo_with_newline" && printf " (master)" >expected && git init "$repo_with_newline" && test_when_finished "rm -rf \"$repo_with_newline\"" && @@ -148,7 +145,7 @@ test_expect_success 'prompt - inside .git directory' ' test_expect_success 'prompt - deep inside .git directory' ' printf " (GIT_DIR!)" >expected && ( - cd .git/refs/heads && + cd .git/objects && __git_ps1 >"$actual" ) && test_cmp expected "$actual" @@ -529,7 +526,7 @@ test_expect_success 'prompt - bash color pc mode - branch name' ' printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected && ( GIT_PS1_SHOWCOLORHINTS=y && - __git_ps1 "BEFORE:" ":AFTER" >"$actual" + __git_ps1 "BEFORE:" ":AFTER" >"$actual" && printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual" ) && test_cmp expected "$actual" @@ -735,22 +732,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" ' |