diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 5716f4b5b..3eec092b9 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -11,7 +11,8 @@ function get_local_branch() { # Return active branch cd "${1}" 2> /dev/null || return 1 - git rev-parse --abbrev-ref HEAD || return 1 + local foundBranch=$(git show-ref --heads | grep "$(git rev-parse HEAD)" | awk '{print $2;}' | cut -d '/' -f 3) + echo "${foundBranch:-HEAD}" } function get_local_version() { @@ -36,7 +37,6 @@ function get_remote_version() { fi } - function get_remote_hash(){ git ls-remote "https://github.com/arevindh/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || { git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1; } }