fix(klipper): Check for updates on custom branch

If a custom Klipper repository is not using 'master' as the branch
checking for updates will fail or give stale data.

Fix this by checking the custom branch instead.
This commit is contained in:
Jookia
2023-04-16 11:32:43 +10:00
parent 5b890fb0fb
commit 4b966869e0

View File

@@ -590,8 +590,14 @@ function get_remote_klipper_commit() {
[[ ! -d ${KLIPPER_DIR} || ! -d "${KLIPPER_DIR}/.git" ]] && return
local commit
local branch
read_kiauh_ini "${FUNCNAME[0]}"
branch="${custom_klipper_repo_branch}"
[[ -z ${branch} ]] && branch="master"
cd "${KLIPPER_DIR}" && git fetch origin -q
commit=$(git describe origin/master --always --tags | cut -d "-" -f 1,2)
commit=$(git describe "origin/${branch}" --always --tags | cut -d "-" -f 1,2)
echo "${commit}"
}