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 $? }