From 933956392ee57875b00657c5c5a75ea853cb819b Mon Sep 17 00:00:00 2001 From: Lucas Pinheiro Date: Fri, 19 Apr 2024 08:50:34 -0300 Subject: [PATCH] fix: use --depth on git fetch for PRs --- libcheckout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcheckout b/libcheckout index 90f4f5ff..058d5def 100755 --- a/libcheckout +++ b/libcheckout @@ -226,7 +226,7 @@ function checkout::refbased() { retry git clone --depth "${SEMAPHORE_GIT_DEPTH}" "${SEMAPHORE_GIT_URL}" "${SEMAPHORE_GIT_DIR}" cd "${SEMAPHORE_GIT_DIR}" || exit - if ! retry git fetch origin +"${SEMAPHORE_GIT_REF}": 2>/dev/null; then + if ! retry git fetch --depth "${SEMAPHORE_GIT_DEPTH}" origin +"${SEMAPHORE_GIT_REF}": 2>/dev/null; then echo "Revision: ${SEMAPHORE_GIT_SHA} not found .... Exiting" return 1 else