1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

git-cache: consider if git_cache dir is present

This commit is contained in:
BytesGalore 2017-01-04 17:10:48 +01:00
parent 1df4f9ff66
commit bc60be10d0

View File

@ -72,7 +72,11 @@ drop() {
}
_check_commit() {
git_cache cat-file -e ${1}^{commit}
if [ -d "${GIT_CACHE_DIR}" ]; then
git_cache cat-file -e ${1}^{commit}
else
false
fi
}
_remote_name() {
@ -98,7 +102,7 @@ clone() {
git_cache tag commit$SHA1 $SHA1 || true # ignore possibly already existing tag
git clone --reference "${GIT_CACHE_DIR}" "${GIT_CACHE_DIR}" "${TARGET_PATH}" --branch commit$SHA1
else
git clone --reference "${GIT_CACHE_DIR}" "${REMOTE}" "${TARGET_PATH}"
git clone "${REMOTE}" "${TARGET_PATH}"
git -C "${TARGET_PATH}" checkout $SHA1
fi
set +e