better checks
This commit is contained in:
parent
19db503029
commit
bf48ddc00b
@ -103,10 +103,10 @@ function build_prompt {
|
|||||||
commits_ahead=${#commits_ahead[@]}
|
commits_ahead=${#commits_ahead[@]}
|
||||||
commits_behind=${#commits_behind[@]}
|
commits_behind=${#commits_behind[@]}
|
||||||
|
|
||||||
if [[ $commits_ahead > 0 && $commits_behind > 0 ]]; then
|
if [[ $commits_ahead -gt 0 && $commits_behind -gt 0 ]]; then
|
||||||
has_diverged=true
|
has_diverged=true
|
||||||
fi
|
fi
|
||||||
if [[ $commits_ahead == 0 && $commits_behind > 0 ]]; then
|
if [[ $commits_ahead == 0 && $commits_behind -gt 0 ]]; then
|
||||||
can_fast_forward=true
|
can_fast_forward=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -153,10 +153,10 @@ function build_prompt {
|
|||||||
if [[ $has_diverged == true ]]; then
|
if [[ $has_diverged == true ]]; then
|
||||||
PS1="${PS1}-${commits_behind} ${has_diverged_symbol} +${commits_ahead} "
|
PS1="${PS1}-${commits_behind} ${has_diverged_symbol} +${commits_ahead} "
|
||||||
else
|
else
|
||||||
if [[ $commits_behind > 0 ]]; then
|
if [[ $commits_behind -gt 0 ]]; then
|
||||||
PS1="${PS1}${on} -${commits_behind} ${can_fast_forward_symbol} "
|
PS1="${PS1}${on} -${commits_behind} ${can_fast_forward_symbol} "
|
||||||
fi
|
fi
|
||||||
if [[ $commits_ahead > 0 ]]; then
|
if [[ $commits_ahead -gt 0 ]]; then
|
||||||
PS1="${PS1}${on} ${should_push_symbol} +${commits_ahead} "
|
PS1="${PS1}${on} ${should_push_symbol} +${commits_ahead} "
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user