bash prompt: combine 'git rev-parse' for detached head
[gitweb.git] / t / t9903-bash-prompt.sh
index 0d53aa6d6948640d287bc514ae9b001cfbf71a42..b9895c797c97e9547a8a5fef639292765f45bc99 100755 (executable)
@@ -49,6 +49,14 @@ test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
        test_cmp expected "$actual"
 '
 
+test_expect_success 'prompt - unborn branch' '
+       printf " (unborn)" >expected &&
+       git checkout --orphan unborn &&
+       test_when_finished "git checkout master" &&
+       __git_ps1 >"$actual" &&
+       test_cmp expected "$actual"
+'
+
 test_expect_success 'prompt - detached head' '
        printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected &&
        test_config core.abbrev 13 &&