From a04e43ae517cad6c3a9b59e023c9d0b60d0bd8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 22 Aug 2021 23:28:57 -0500 Subject: fix check upstream --- hyperterm/core/git.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hyperterm/core') diff --git a/hyperterm/core/git.sh b/hyperterm/core/git.sh index 616e158..9b2ee5a 100644 --- a/hyperterm/core/git.sh +++ b/hyperterm/core/git.sh @@ -146,10 +146,13 @@ function _git_dirty_count() { fi } -___upstream="$(git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" 2> /dev/null)" +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 __behind_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f1 2> /dev/null)" case $__behind_count in @@ -161,6 +164,7 @@ function _git_behind_count() { function _git_ahead_count() { local __ahead_count + _git_upstream if [[ -n $___upstream ]]; then __ahead_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f2 2> /dev/null)" case $__ahead_count in -- cgit v1.2.3