mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-23 11:36:07 +02:00
fix(updater): follow first-parent history for cooldown
This commit is contained in:
@@ -57,7 +57,7 @@ function is_update_available() {
|
||||
(builtin cd -q "$ZSH"; LANG= git fetch --quiet $remote $branch) || return 1
|
||||
zmodload zsh/datetime
|
||||
cutoff_epoch=$(( EPOCHSECONDS - cooldown_days * 86400 ))
|
||||
cooldown_ref=$(builtin cd -q "$ZSH"; git log --format="%H %ct" FETCH_HEAD \
|
||||
cooldown_ref=$(builtin cd -q "$ZSH"; git log --first-parent --format="%H %ct" FETCH_HEAD \
|
||||
| awk -v c="$cutoff_epoch" '$2 <= c { print $1; exit }')
|
||||
[[ -n "$cooldown_ref" ]] || return 1
|
||||
[[ "$cooldown_ref" != "$local_head" ]] || return 1
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ update_with_cooldown() {
|
||||
cutoff_epoch=$(( EPOCHSECONDS - cooldown_days * 86400 ))
|
||||
LANG= git fetch --quiet $remote $branch || return $?
|
||||
|
||||
cooldown_ref=$(git log --format="%H %ct" FETCH_HEAD \
|
||||
cooldown_ref=$(git log --first-parent --format="%H %ct" FETCH_HEAD \
|
||||
| awk -v c="$cutoff_epoch" '$2 <= c { print $1; exit }')
|
||||
|
||||
[[ -n "$cooldown_ref" ]] || return 0
|
||||
|
||||
Reference in New Issue
Block a user