upload-pack: support hidden refs with protocol v2
[gitweb.git] / t / t9903-bash-prompt.sh
index 04440685a66d6baff98c1739979c8f866255572b..81a5179e28bf529bc2f0a8bc197108fcb69fba72 100755 (executable)
@@ -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\"" &&
@@ -516,10 +513,9 @@ test_expect_success 'prompt - format string starting with dash' '
 
 test_expect_success 'prompt - pc mode' '
        printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected &&
-       printf "" >expected_output &&
        (
                __git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
-               test_cmp expected_output "$actual" &&
+               test_must_be_empty "$actual" &&
                printf "%s\\n%s" "$PS1" "${__git_ps1_branch_name}" >"$actual"
        ) &&
        test_cmp expected "$actual"
@@ -715,13 +711,12 @@ test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var set, config unset' '
-       printf "" >expected &&
        (
                cd ignored_dir &&
                GIT_PS1_HIDE_IF_PWD_IGNORED=y &&
                __git_ps1 >"$actual"
        ) &&
-       test_cmp expected "$actual"
+       test_must_be_empty "$actual"
 '
 
 test_expect_success 'prompt - hide if pwd ignored - env var set, config unset, pc mode' '