uniq paranthesis

This commit is contained in:
Jakobus Schürz 2020-07-14 08:22:42 +02:00
parent 0fa072f766
commit a22083d54a

2
PS1
View file

@ -1,7 +1,7 @@
# /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 LBRANCH="$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ \1/p'|sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//')" local LBRANCH="$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ \1/p'|sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//'|tr -s '()')"
local RBRANCH="$( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null |sed -e 's/^[[:blank:]]*//' )" local RBRANCH="$( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null |sed -e 's/^[[:blank:]]*//' )"
[ -z "${RBRANCH-x}" ] && unset RBRANCH [ -z "${RBRANCH-x}" ] && unset RBRANCH
local BRANCH="${LBRANCH}${RBRANCH+ -> }${RBRANCH}" local BRANCH="${LBRANCH}${RBRANCH+ -> }${RBRANCH}"