diff options
author | Jesús <heckyel@hyperbola.info> | 2021-08-22 21:39:34 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-22 21:39:34 -0500 |
commit | 1355a7784ee79522ec9a49d7171e0257a2e813cf (patch) | |
tree | ce0530b00e201cfd1908758d465bde1087b935ee /hyperterm | |
parent | eae313436c568e6bcab8c219dc38a8fa825269c7 (diff) | |
download | hyperterm-1355a7784ee79522ec9a49d7171e0257a2e813cf.tar.lz hyperterm-1355a7784ee79522ec9a49d7171e0257a2e813cf.tar.xz hyperterm-1355a7784ee79522ec9a49d7171e0257a2e813cf.zip |
fix fatal: ambiguous argument 'origin...HEAD'
unknown revision or path not in the working tree
Diffstat (limited to 'hyperterm')
-rw-r--r-- | hyperterm/core/git.sh | 29 | ||||
-rw-r--r-- | hyperterm/hyperterm.sha512 | 2 |
2 files changed, 19 insertions, 12 deletions
diff --git a/hyperterm/core/git.sh b/hyperterm/core/git.sh index accb1e3..6cf9854 100644 --- a/hyperterm/core/git.sh +++ b/hyperterm/core/git.sh @@ -146,22 +146,28 @@ function _git_dirty_count() { fi } +___upstream="$(git rev-parse --symbolic-full-name --abbrev-ref "@{upstream}" 2> /dev/null)" + function _git_behind_count() { local __behind_count - __behind_count="$(git rev-list --left-right --count origin/master...HEAD | cut -f1 2> /dev/null)" - case $__behind_count in - 0) echo -n '';; - *) echo -n "$__behind_count";; - esac + if [[ -s $___upstream ]]; then + __behind_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f1 2> /dev/null)" + case $__behind_count in + 0) echo -n '';; + *) echo -n "$__behind_count";; + esac + fi } function _git_ahead_count() { local __ahead_count - __ahead_count="$(git rev-list --left-right --count origin/master...HEAD | cut -f2 2> /dev/null)" - case $__ahead_count in - 0) echo -n '';; - *) echo -n "$__ahead_count";; - esac + if [[ -s $___upstream ]]; then + __ahead_count="$(git rev-list --left-right --count "$___upstream"...HEAD | cut -f2 2> /dev/null)" + case $__ahead_count in + 0) echo -n '';; + *) echo -n "$__ahead_count";; + esac + fi } # ends counter on git @@ -278,7 +284,7 @@ function _prompt_get_git_status() { 011110011) printf '%s%s' "${__ps}${__dss}${__nfs}${__uts}" "$count_dirty";; 011111011) printf '%s%s' "${__ps}${__dss}${__uts}" "$count_dirty";; 011101001) printf '%s%s' "${__ps}${__dss}${__usts}${__uts}${__dfs}" "$count_dirty";; - 011101001) printf '%s%s' "${__ps}${__dss}${__usts}${__dfs}" "$count_dirty";; + 011001111) printf '%s%s' "${__ps}${__dss}${__stusts}" "$count_dirty";; 011111110) printf '%s%s' "${__ps}${__dss}${__rns}" "$count_dirty";; 011110110) printf '%s%s' "${__ps}${__dss}${__nfs}${__rns}" "$count_dirty";; 011110010) printf '%s%s' "${__ps}${__dss}${__nfs}${__uts}${__rns}" "$count_dirty";; @@ -312,6 +318,7 @@ function _prompt_get_git_status() { 001111011) printf '%s%s' "${__ps}${__duus}${__uts}" "$count_dirty";; 001101001) printf '%s%s' "${__ps}${__duus}${__usts}${__uts}${__dfs}" "$count_dirty";; 001101101) printf '%s%s' "${__ps}${__duus}${__usts}${__dfs}" "$count_dirty";; + 111001111) printf '%s%s' "${__ps}${__duus}${__stusts}" "$count_dirty";; 001111110) printf '%s%s' "${__ps}${__duus}${__rns}" "$count_dirty";; 001110110) printf '%s%s' "${__ps}${__duus}${__nfs}${__rns}" "$count_dirty";; 001110010) printf '%s%s' "${__ps}${__duus}${__nfs}${__uts}${__rns}" "$count_dirty";; diff --git a/hyperterm/hyperterm.sha512 b/hyperterm/hyperterm.sha512 index 3a74beb..7ea4459 100644 --- a/hyperterm/hyperterm.sha512 +++ b/hyperterm/hyperterm.sha512 @@ -13,7 +13,7 @@ fab9d339a99c7d2e1809d1c44f533523c6bfcdcc8d63c62b335ce7d4c666c8bdd7ac319316bf71f0 6f3aaa2ab53b33e3505d46d78040bab66c583986583d67e0712fdad06d78ad0608cc2606f639d128e8013177ea9cf07b7cf4c65758a750529d724bc3bdeb5be0 ./tools/network.sh 7447d3e167ab207d3ef4218e201a06bf5a3fc23281639f16f7f405f1d66b73923845d450fdb0a94672757866a9da0324f728564a1b61b2ed1678fe576eb565cf ./core/autocomplete.sh 065cfa39f1b4312ed275ad1039827a24f703176c653a8d27303d145f9d389a60ec5b3a9eb167e060cc6fd093b9c03cfb1a8b70254d444fbc6e62e2297d88b310 ./core/status.sh -3cdfedebc1b15c342c0dabde7501fac4a7c2ac13f31cd84792d8d7f407659535e3baf6472c039ea542dc573d7a88811df58f34f2cd1bbd1de3f35434122314cf ./core/git.sh +e7c13363405709475060cd999b665762dc9e3755cf7f154bf8583cd807eb2bd063e5215d2fd5e67cbf92c00b5cb1dae68724bacb93e96fca04f8cdffdd9485e8 ./core/git.sh 915196c638ac432a0eccb4cd127af14398385cb7094b3f6142adc21e4c4f155214ead74511f21b6acf20d2edad8934e893a8900ceafc59df8e66bc789095d58c ./core/update.sh f3e00b2aa8ab9f3ab44570adaa2520408ed66fd00f551654d60b64a4be3546ec781b7efa39bcd774937e654b6ffb4c7af3f21eeb36caf9c01f82f85cf28e2b4d ./core/languages.sh 1cfba599047d84a17ff92b695ebf527a505a30acc9ec21a2b9f410a7ea6dde4b23b5cf62e557d82f2fe9a8980649942424b879ca53baae4d4cb3057681baa7b6 ./core/colors.sh |