try to fix the update function.

This commit is contained in:
Storm Dragon 2022-03-15 01:12:04 -04:00
parent 1c86899ea7
commit c8917b1486

View File

@ -47,7 +47,12 @@ export DIALOGOPTS='--no-lines --visit-items'
# Check for updates
check_update() {
local branch="$(git rev-parse --abbrev-ref HEAD)"
local url="$(git ls-remote --get-url)"
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