Use git depth=1 when cloning llvm

This commit is contained in:
Adrian Antkowiak authored and Martin Storsjö committed 2021-07-05 23:32:07 +03:00
1 parent 46efff459a
commit 9b6966484f
1 file changed
+12 -4
+12 -4
View File
@@ -72,15 +72,23 @@ if [ -z "$CHECKOUT_ONLY" ]; then
fi fi
if [ ! -d llvm-project ]; then if [ ! -d llvm-project ]; then
# When cloning master and checking out a pinned old hash, we can't use --depth=1. mkdir llvm-project
git clone https://github.com/llvm/llvm-project.git cd llvm-project
git init
git remote add origin https://github.com/llvm/llvm-project.git
git fetch --depth 1 origin "$LLVM_VERSION"
git checkout FETCH_HEAD
cd ..
CHECKOUT=1 CHECKOUT=1
unset SYNC
fi fi
if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
cd llvm-project cd llvm-project
[ -z "$SYNC" ] || git fetch if [ -n "$SYNC" ]; then
git checkout $LLVM_VERSION git fetch --depth 1 origin "$LLVM_VERSION"
git checkout FETCH_HEAD
fi
if [ "$LLVM_VERSION" = "llvmorg-12.0.0" ]; then if [ "$LLVM_VERSION" = "llvmorg-12.0.0" ]; then
# The bundled patches for std::filesystem apply on the 12.0.0 release, # The bundled patches for std::filesystem apply on the 12.0.0 release,
# but don't try to apply them if a different version was requested. # but don't try to apply them if a different version was requested.