-git fetch --unshallow || echo "Repository already has full history"
# - git fetch --unshallow || echo "Repository already has full history"
# Safely handle missing CI_COMMIT_BEFORE_SHA
-if [ -z "$CI_COMMIT_BEFORE_SHA" ] || ! git rev-parse "$CI_COMMIT_BEFORE_SHA" >/dev/null 2>&1; then echo "Previous commit SHA is not available. Using HEAD~1 for comparison."; CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD~1); fi
# # Safely handle missing CI_COMMIT_BEFORE_SHA
# - if [ -z "$CI_COMMIT_BEFORE_SHA" ] || ! git rev-parse "$CI_COMMIT_BEFORE_SHA" >/dev/null 2>&1; then echo "Previous commit SHA is not available. Using HEAD~1 for comparison."; CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD~1); fi