From 3cd97dc044d5e8dee664af363881a26bb2859d9c Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 15 Mar 2022 02:07:13 -0400 Subject: [PATCH] One more attempt to fix the update function. --- linux-game-manager.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-game-manager.sh b/linux-game-manager.sh index 657110f..8da414a 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -51,15 +51,15 @@ check_update() { if [[ "$url" =~ ^ssh://|git@ ]] || [[ -z "$url" ]]; then return fi - git fetch - local branch="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" - local localSha="$(git rev-parse origin/${branch})" - local remoteSha="$(git rev-parse refs/remotes/origin/${branch})" - if [[ "${localSha}" == "${remoteSha}" ]]; then - return - fi + git remote update &> /dev/null + local upstream='@{u}' + local home="$(git rev-parse @)" + local remote="$(git rev-parse "$upstream")" +if [[ "$home" == "$remote" ]]; then + return +fi dialog --backtitle "Linux Game manager" \ - --yesno "Updates are available. Would you like to update now?" -1 -1 || return + --yesno "Updates are available. Would you like to update now?" -1 -1 --stdout || return git pull exit $? }