aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc6
1 files changed, 3 insertions, 3 deletions
diff --git a/.bashrc b/.bashrc
index f34c245..28e96c0 100644
--- a/.bashrc
+++ b/.bashrc
@@ -97,10 +97,10 @@ prompt_command_notitle () {
local fullbranch="$(cat .git/HEAD 2>/dev/null)"
if [ "$fullbranch" = "" ]; then
- local fullbranch="ref: $(git symbolic-ref HEAD 2>/dev/null)"
+ local fullbranch="$(git symbolic-ref HEAD 2>/dev/null)"
fi
- local branch="${fullbranch#ref: refs/heads/}"
- vcsinfo="${branch:+#$branch}"
+ local branch="${fullbranch##ref: }"
+ vcsinfo="${branch:+#${branch##refs/heads/}}"
}
prompt_command () {
nihil fit ex nihilo