util/release: Try reusing the local checkout for cloning

git clone allows using a local repo as reference which reduces the
required network traffic.

Change-Id: I64722cd5dbdfc0c2bcd935715cffdb99b773711c
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36954
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi 2019-11-19 17:11:04 +01:00
parent d198e2e553
commit 54cabb977d
1 changed files with 7 additions and 2 deletions

View File

@ -39,10 +39,15 @@ if ! tar --sort=name -cf /dev/null /dev/null 2>/dev/null ; then
fi fi
if [ ! -d "coreboot-${VERSION_NAME}" ]; then if [ ! -d "coreboot-${VERSION_NAME}" ]; then
if [ -d .git ]; then
GIT_REF_OPTS="--reference . --dissociate"
elif [ -d ../../.git ]; then
GIT_REF_OPTS="--reference ../.. --dissociate"
fi
if [ -n "${USERNAME}" ]; then if [ -n "${USERNAME}" ]; then
git clone "ssh://${USERNAME}@review.coreboot.org:29418/coreboot.git" "coreboot-${VERSION_NAME}" git clone ${GIT_REF_OPTS} "ssh://${USERNAME}@review.coreboot.org:29418/coreboot.git" "coreboot-${VERSION_NAME}"
else else
git clone https://review.coreboot.org/coreboot.git "coreboot-${VERSION_NAME}" git clone ${GIT_REF_OPTS} https://review.coreboot.org/coreboot.git "coreboot-${VERSION_NAME}"
fi fi
fi fi