fix: reduce git-fetch depth to 1
Fixes a fetch failure when cloning Hafnium on the LTS branch. The issue
arises from unreachable Git objects referenced in Hafnium’s
history—likely from early patches (e.g., [1], [2]) that were either
unmerged or lost during migration from Google to Linaro’s Gerrit
instance.
To prevent attempts at dereferencing these unreachable objects, restrict
git fetch to a depth of 1. This ensures only the required tag or commit
is fetched and avoids scanning the full object history.
A longer-term fix is also underway by pushing the missing patches to
Gerrit so their objects remain accessible.
References:
1. https://hafnium-review.googlesource.com/c/hafnium/prebuilts/+/8461/11
2. https://hafnium-review.googlesource.com/c/hafnium/prebuilts/+/6841/4
Change-Id: Ie4281bbbec65efc5e9c83d02ee90b267b996fbdf
Signed-off-by: Harrison Mutai harrison.mutai@arm.com
diff --git a/scripts/clone.sh b/scripts/clone.sh
index e28c331..7da0e5b 100755
--- a/scripts/clone.sh
+++ b/scripts/clone.sh
@@ -188,7 +188,7 @@
if [[ ${FETCH_SSH} ]]; then
GIT_SSH_COMMAND="ssh ${SSH_PARAMS}" git fetch ${REPO_SSH_URL} ${REPO_REFSPEC}
else
- git fetch ${REPO_URL} ${REPO_REFSPEC}
+ git fetch --depth 1 ${REPO_URL} ${REPO_REFSPEC}
fi
git checkout FETCH_HEAD