Use -n instead of ! -z

This commit is contained in:
Jesús 2021-08-22 23:16:00 -05:00
parent 50cc4c28b6
commit cb1d4f4995
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -150,7 +150,7 @@ ___upstream="$(git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" 2>
function _git_behind_count() { function _git_behind_count() {
local __behind_count local __behind_count
if [[ ! -z $___upstream ]]; then if [[ -n $___upstream ]]; then
__behind_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f1 2> /dev/null)" __behind_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f1 2> /dev/null)"
case $__behind_count in case $__behind_count in
0) echo -n '';; 0) echo -n '';;
@ -161,7 +161,7 @@ function _git_behind_count() {
function _git_ahead_count() { function _git_ahead_count() {
local __ahead_count local __ahead_count
if [[ ! -z $___upstream ]]; then if [[ -n $___upstream ]]; then
__ahead_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f2 2> /dev/null)" __ahead_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f2 2> /dev/null)"
case $__ahead_count in case $__ahead_count in
0) echo -n '';; 0) echo -n '';;