fix branch

This commit is contained in:
Jakobus Schürz 2020-07-14 00:46:43 +02:00
parent d251a9d34e
commit 0a8cffb3b9

8
PS1
View file

@ -1,9 +1,11 @@
# /etc/profile.d/PS1.sh: executed by Bourne-compatible login shells. # /etc/profile.d/PS1.sh: executed by Bourne-compatible login shells.
parse_git_branch() { parse_git_branch() {
local BRANCH=$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ (\1/p') local LBRANCH="$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ \1/p'|tr -d \"[:blank:]\")"
BRANCH="$BRANCH ${BRANCH-->} $( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null ) )" local RBRANCH="$( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null |tr -d \"[:blank:]\" )"
echo $BRANCH [ -z "${RBRANCH-x}" ] && unset RBRANCH
local BRANCH="$LBRANCH ${RBRANCH+->} $RBRANCH"
[ -z "${LBRANCH+x}" -o -z "${RBRANCH}" ] || echo "($BRANCH)"
} }
set_label() { set_label() {