File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 33set -xeuo pipefail
44
55FETCH_DEPTH=${FETCH_DEPTH:- 1}
6+ REFERENCE_REPO_PATH=${REFERENCE_REPO_PATH:-/ libbpfci/ mirrors/ linux}
67
78echo KERNEL_ORIGIN = ${KERNEL_ORIGIN}
89echo KERNEL_BRANCH = ${KERNEL_BRANCH}
@@ -13,10 +14,12 @@ if [ -d "${REPO_PATH}" ]; then
1314 exit 1
1415fi
1516
16- mkdir -p " ${REPO_PATH} "
17- cd " ${REPO_PATH} "
17+ clone_args=()
18+ clone_args+=(--branch ${KERNEL_BRANCH} )
19+ clone_args+=(--reference-if-able ${REFERENCE_REPO_PATH} )
20+ if [ ${FETCH_DEPTH} -ge 1 ]; then
21+ clone_args+=(--depth ${FETCH_DEPTH} )
22+ fi
23+
24+ git clone " ${clone_args[@]} " ${KERNEL_ORIGIN} ${REPO_PATH}
1825
19- git init
20- git remote add origin ${KERNEL_ORIGIN}
21- git fetch --depth=${FETCH_DEPTH} origin ${KERNEL_BRANCH}
22- git checkout FETCH_HEAD
You can’t perform that action at this time.
0 commit comments