Skip to content

Commit 92229a1

Browse files
committed
Use shallow clone in update-vendor.sh
1 parent 30ee31d commit 92229a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cluster-autoscaler/hack/update-vendor.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ set +o errexit
8080

8181
if [ ! -d ${K8S_REPO} ]; then
8282
echo "Cloning ${K8S_FORK} into ${K8S_REPO}"
83-
git clone ${K8S_FORK} ${K8S_REPO} >&${BASH_XTRACEFD} 2>&1
83+
git clone --depth 1 ${K8S_FORK} ${K8S_REPO} >&${BASH_XTRACEFD} 2>&1
8484
fi
8585

8686
pushd ${K8S_REPO} >/dev/null
87-
git checkout ${K8S_REV} >&${BASH_XTRACEFD} 2>&1
88-
K8S_REV_PARSED=$(git rev-parse ${K8S_REV})
87+
git fetch --depth 1 origin ${K8S_REV} >&${BASH_XTRACEFD} 2>&1
88+
git checkout FETCH_HEAD >&${BASH_XTRACEFD} 2>&1
89+
K8S_REV_PARSED=$(git rev-parse FETCH_HEAD)
8990
popd >/dev/null
9091

9192

0 commit comments

Comments
 (0)