aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/core/git.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-08-22 23:28:57 -0500
committerJesús <heckyel@hyperbola.info>2021-08-22 23:28:57 -0500
commita04e43ae517cad6c3a9b59e023c9d0b60d0bd8fe (patch)
treeb517fa67b10b5eb22db89d48f6a78cffe7d54cc8 /hyperterm/core/git.sh
parent2f57edbb77677a8f4c37cd132790f1ee985ac375 (diff)
downloadhyperterm-a04e43ae517cad6c3a9b59e023c9d0b60d0bd8fe.tar.lz
hyperterm-a04e43ae517cad6c3a9b59e023c9d0b60d0bd8fe.tar.xz
hyperterm-a04e43ae517cad6c3a9b59e023c9d0b60d0bd8fe.zip
fix check upstream
Diffstat (limited to 'hyperterm/core/git.sh')
-rw-r--r--hyperterm/core/git.sh6
1 files changed, 5 insertions, 1 deletions
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