diff options
Diffstat (limited to 'hyperterm/core')
-rw-r--r-- | hyperterm/core/git.sh | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/hyperterm/core/git.sh b/hyperterm/core/git.sh index f008d84..1488a93 100644 --- a/hyperterm/core/git.sh +++ b/hyperterm/core/git.sh @@ -146,14 +146,9 @@ function _git_dirty_count() { fi } -function _git_upstream() { - ___upstream="$(git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" 2> /dev/null)" -} - function _git_behind_count() { local __behind_count - _git_upstream - if [[ -n $___upstream ]]; then + if git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" > /dev/null 2>&1; then __behind_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f1 2> /dev/null)" case $__behind_count in 0) echo -n '';; @@ -164,8 +159,7 @@ function _git_behind_count() { function _git_ahead_count() { local __ahead_count - _git_upstream - if [[ -n $___upstream ]]; then + if git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" > /dev/null 2>&1; then __ahead_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f2 2> /dev/null)" case $__ahead_count in 0) echo -n '';; |