From 792b7301351df20256d4bb88110d3bc6ce4513f6 Mon Sep 17 00:00:00 2001 From: Matthew Gabeler-Lee Date: Wed, 13 Feb 2013 20:16:18 -0500 Subject: [PATCH] Ask git server what head revision is before downloading the repo --- rpi-update | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpi-update b/rpi-update index 0eddcde..c1ceef6 100755 --- a/rpi-update +++ b/rpi-update @@ -197,11 +197,14 @@ if [[ ${FW_REV} != "" ]]; then download_rev do_update "updated to revision ${FW_REV}" elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then - update_repo - if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == $(eval ${GITCMD} rev-parse master) ]]; then + # ask git server version before spending time cloning + GITREV=$(git ls-remote -h ${REPO_URI} refs/heads/master | awk '{print $1}') + if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == "$GITREV" ]]; then echo " *** Your firmware is already up to date" - finalise + # no changes made, nothing to finalise + # finalise else + update_repo do_update "updated" fi else