From adf9daa9b7ec757a0cdc7ed92a5ad53579c2f32c Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 16 Nov 2018 12:09:55 +0100 Subject: [PATCH 1/2] Modified the update check in update.sh to fetch the newest revision directly from github without having to run git fetch first. --- update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 5b38d7d0..fe5aafe0 100755 --- a/update.sh +++ b/update.sh @@ -62,8 +62,12 @@ while (($#)); do case "${1}" in --check|-c) echo "Checking remote code for updates..." - git fetch origin #${BRANCH} - if [[ -z $(git log HEAD --pretty=format:"%H" | grep $(git rev-parse origin/${BRANCH})) ]]; then + LATEST_REV=$(git ls-remote --exit-code --refs --quiet https://github.com/mailcow/mailcow-dockerized ${BRANCH} | cut -f1) + if [ $? -ne 0 ]; then + echo "A problem occurred while trying to fetch the latest revision from github." + exit 99 + fi + if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then echo "Updated code is available." exit 0 else From 8f6c24e60abc32323695aac0fa10afdb9c9323bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Peters?= Date: Tue, 12 Mar 2019 17:21:45 +0100 Subject: [PATCH 2/2] Update update.sh --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index fe5aafe0..2d528e64 100755 --- a/update.sh +++ b/update.sh @@ -66,7 +66,7 @@ while (($#)); do if [ $? -ne 0 ]; then echo "A problem occurred while trying to fetch the latest revision from github." exit 99 - fi + fi if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then echo "Updated code is available." exit 0