aboutsummaryrefslogtreecommitdiff
path: root/pdksh
diff options
context:
space:
mode:
Diffstat (limited to 'pdksh')
-rw-r--r--pdksh/pdkshrc.d/prompt.pdksh6
1 files changed, 4 insertions, 2 deletions
diff --git a/pdksh/pdkshrc.d/prompt.pdksh b/pdksh/pdkshrc.d/prompt.pdksh
index bac505a4..920e21ae 100644
--- a/pdksh/pdkshrc.d/prompt.pdksh
+++ b/pdksh/pdkshrc.d/prompt.pdksh
@@ -99,8 +99,10 @@ prompt() {
# failing all of that just show the short commit ID, in that order
# of preference; if none of that works, bail out
typeset name
- name=$(git describe --all --always --exact-match \
- HEAD 2>/dev/null) || return
+ name=$( {
+ git symbolic-ref --quiet HEAD ||
+ git describe --all --always --exact-match HEAD
+ } 2>/dev/null) || return
name=${name##*/}
[[ -n $name ]] || return