aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/core
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-11-09 17:00:07 -0500
committerJesús <heckyel@hyperbola.info>2021-11-09 17:00:07 -0500
commit2e484b74f685646a34173e9fbf71b09c0b63323d (patch)
treec828c1d5dfd49dca0f99914a208502704b935313 /hyperterm/core
parent3852f2b07af746032293515c15c38064b815a308 (diff)
downloadhyperterm-2e484b74f685646a34173e9fbf71b09c0b63323d.tar.lz
hyperterm-2e484b74f685646a34173e9fbf71b09c0b63323d.tar.xz
hyperterm-2e484b74f685646a34173e9fbf71b09c0b63323d.zip
git: fix upstream command
fatal: argumento ambiguo '@{upstream}...HEAD': revisión desconocida o ruta fuera del árbol de trabajo. Use '--' para separar las rutas de las revisiones, de esta manera: 'git <comando> [<revisión>...] -- [<archivo>...]' fatal: argumento ambiguo '@{upstream}...HEAD': revisión desconocida o ruta fuera del árbol de trabajo. Use '--' para separar las rutas de las revisiones, de esta manera: 'git <comando> [<revisión>...] -- [<archivo>...]'
Diffstat (limited to 'hyperterm/core')
-rw-r--r--hyperterm/core/git.sh10
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 '';;