uniq paranthesis
This commit is contained in:
parent
0fa072f766
commit
a22083d54a
1 changed files with 1 additions and 1 deletions
2
PS1
2
PS1
|
@ -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}"
|
||||||
|
|
Loading…
Reference in a new issue