From: Fabian Castelli Date: Thu, 17 Jun 2021 16:56:55 +0000 (+0200) Subject: Correctly checkout the desired version for git repositories X-Git-Tag: v9.3.0-r3~14^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F189%2Fhead;p=candi.git Correctly checkout the desired version for git repositories --- diff --git a/candi.sh b/candi.sh index 0f49fa6..fb26899 100755 --- a/candi.sh +++ b/candi.sh @@ -335,20 +335,22 @@ package_fetch () { quit_if_fail "candi: download_archive ${NAME}${PACKING} failed" elif [ ${PACKING} = "git" ]; then + # Go into the unpack dir cd ${UNPACK_PATH} - # Suitably clone or update git repositories + + # Clone the git repository if not existing locally if [ ! -d ${EXTRACTSTO} ]; then git clone ${SOURCE}${NAME} ${EXTRACTSTO} quit_if_fail "candi: git clone ${SOURCE}${NAME} ${EXTRACTSTO} failed" - else - cd ${EXTRACTSTO} - git checkout ${VERSION} --force - quit_if_fail "candi: git checkout ${VERSION} --force failed" - - git pull - quit_if_fail "candi: git pull failed" - cd .. fi + + # Checkout the desired version + cd ${EXTRACTSTO} + git checkout ${VERSION} --force + quit_if_fail "candi: git checkout ${VERSION} --force failed" + + # Switch to the tmp dir + cd .. elif [ ${PACKING} = "hg" ]; then cd ${UNPACK_PATH} # Suitably clone or update hg repositories