diff options
Diffstat (limited to '')
| -rwxr-xr-x | git-sonar | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -83,6 +83,7 @@ FETCH_TIME="${GIT_SONAR_FETCH_TIME:-"300"}" ALERT_ICON="${GIT_SONAR_ALERT_ICON:-"${COLOR_YELLOW}⚡"}" STASH_ICON="${GIT_SONAR_STASH_ICON:-"${COLOR_YELLOW}≡"}" BRANCH_COLOR="${GIT_SONAR_BRANCH_COLOR:-"$COLOR_DEF"}" +DETACHED_COLOR="${GIT_SONAR_DETACHED_COLOR:-"$COLOR_DEF"}" STATUS_SEP="${GIT_SONAR_STATUS_SEPARATOR:-" "}" AHEAD_ICON="${GIT_SONAR_AHEAD_ICON:-"${COLOR_GREEN}↑"}" # "←" @@ -140,8 +141,11 @@ element_alert() { } element_branch() { - [ -n "$branch_name" ] && branch="$branch_name" || branch="detached@${commit_hash}" - printf '%b%s%b' "$BRANCH_COLOR" "$branch" "$COLOR_DEF" + if [ -n "$branch_name" ]; then + printf '%b%s%b' "$BRANCH_COLOR" "$branch_name" "$COLOR_DEF" + else + printf '%bdetached@%s%b' "$DETACHED_COLOR" "$commit_hash" "$COLOR_DEF" + fi } element_remote() { |
