센터Git 버전이 낮아, --shallow-exclude 지원하지 않는 경우 얕은 복사로 우회

This commit is contained in:
Lectom C Han
2025-12-17 08:38:11 +09:00
parent 985600cb2d
commit b92f5f6caa
3 changed files with 20 additions and 5 deletions

View File

@@ -44,6 +44,7 @@ jobs:
ROOT_DIR="$(pwd)"
NOTIFY_WEBHOOK="${NOTIFY_WEBHOOK:-}"
SYNC_TAGS="${SYNC_TAGS:-true}"
TARGET_SEED_DEPTH="${TARGET_SEED_DEPTH:-50}"
TOTAL_SUCCESS=0
TOTAL_SKIP=0
TOTAL_ERROR=0
@@ -258,11 +259,23 @@ jobs:
echo "Fetching latest branch '${branch_name}' from source..."
if ! git fetch --no-tags "${shallow_exclude_args[@]}" source "+refs/heads/${branch_name}:refs/heads/${branch_name}"; then
echo "::error::Failed to fetch branch '${branch_name}' from source repo"
notify_status "error" "${repo_name}" "${branch_name}" "${backup_mode}" "${start_epoch}" "source fetch 오류"
cd "${ROOT_DIR}"
rm -rf "${CLONE_DIR}"
return
if [[ "${#shallow_exclude_args[@]}" -gt 0 ]]; then
echo "::warning::shallow-exclude not supported; retrying with target main seed(depth=${TARGET_SEED_DEPTH}) and full fetch"
git fetch --no-tags --depth="${TARGET_SEED_DEPTH}" origin "refs/heads/main:refs/heads/main" || echo "::warning::Seeding from target main skipped (fetch failed or branch missing)"
if ! git fetch --no-tags source "+refs/heads/${branch_name}:refs/heads/${branch_name}"; then
echo "::error::Failed to fetch branch '${branch_name}' from source repo (fallback without shallow-exclude)"
notify_status "error" "${repo_name}" "${branch_name}" "${backup_mode}" "${start_epoch}" "source fetch 오류(폴백)"
cd "${ROOT_DIR}"
rm -rf "${CLONE_DIR}"
return
fi
else
echo "::error::Failed to fetch branch '${branch_name}' from source repo"
notify_status "error" "${repo_name}" "${branch_name}" "${backup_mode}" "${start_epoch}" "source fetch 오류"
cd "${ROOT_DIR}"
rm -rf "${CLONE_DIR}"
return
fi
fi
if [[ "${SYNC_TAGS}" == "true" ]]; then
echo "Fetching tags from source..."