Fix spacing on commits-ahead-behind part
This commit is contained in:
parent
3dc65b4e64
commit
ad0d1cafb4
1 changed files with 10 additions and 4 deletions
|
@ -121,16 +121,22 @@ function git_local_remote_diffs()
|
|||
local commits_behind=$(echo -n "$differences" | awk '{print $2}')
|
||||
local ahead="" behind=""
|
||||
|
||||
local result=""
|
||||
|
||||
(( $commits_ahead > 0 )) \
|
||||
&& ahead="↑$commits_ahead"
|
||||
(( $commits_behind > 0 )) \
|
||||
&& behind="↓$commits_behind"
|
||||
|
||||
if [[ ! -z "${ahead}" ]] || [[ ! -z "${behind}" ]]; then
|
||||
typeset -g REPLY="$ahead $behind"
|
||||
return 0
|
||||
if [[ ! -z "${ahead}" ]]; then
|
||||
result="${ahead} "
|
||||
fi
|
||||
return 1
|
||||
|
||||
if [[ ! -z "${behind}" ]]; then
|
||||
result="${behind} "
|
||||
fi
|
||||
|
||||
typeset -g REPLY="${result}"
|
||||
}
|
||||
|
||||
###
|
||||
|
|
Loading…
Reference in a new issue