From 36f1cd7deae3cb0cb31d3b21ce9613c2feb6d8e6 Mon Sep 17 00:00:00 2001 From: ethernet Date: Thu, 4 Jun 2026 20:35:18 -0400 Subject: [PATCH] feat(installer): do shallow clones no need to get the whole repo history :) --- scripts/install.ps1 | 4 ++-- scripts/install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index a66ba9e8d..d30717b4c 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -1138,7 +1138,7 @@ function Install-Repository { Write-Info "Trying SSH clone..." $env:GIT_SSH_COMMAND = "ssh -o BatchMode=yes -o ConnectTimeout=5" try { - git -c windows.appendAtomically=false clone --branch $Branch $RepoUrlSsh $InstallDir + git -c windows.appendAtomically=false clone --depth 1 --branch $Branch $RepoUrlSsh $InstallDir if ($LASTEXITCODE -eq 0) { $cloneSuccess = $true } } catch { } $env:GIT_SSH_COMMAND = $null @@ -1147,7 +1147,7 @@ function Install-Repository { if (Test-Path $InstallDir) { Remove-Item -Recurse -Force $InstallDir -ErrorAction SilentlyContinue } Write-Info "SSH failed, trying HTTPS..." try { - git -c windows.appendAtomically=false clone --branch $Branch $RepoUrlHttps $InstallDir + git -c windows.appendAtomically=false clone --depth 1 --branch $Branch $RepoUrlHttps $InstallDir if ($LASTEXITCODE -eq 0) { $cloneSuccess = $true } } catch { } } diff --git a/scripts/install.sh b/scripts/install.sh index c5d6732e4..d3095c93e 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1126,12 +1126,12 @@ clone_repo() { # so SSH fails fast instead of hanging when no key is configured. log_info "Trying SSH clone..." if GIT_SSH_COMMAND="ssh -o BatchMode=yes -o ConnectTimeout=5" \ - git clone --branch "$BRANCH" "$REPO_URL_SSH" "$INSTALL_DIR" 2>/dev/null; then + git clone --depth 1 --branch "$BRANCH" "$REPO_URL_SSH" "$INSTALL_DIR" 2>/dev/null; then log_success "Cloned via SSH" else rm -rf "$INSTALL_DIR" 2>/dev/null # Clean up partial SSH clone log_info "SSH failed, trying HTTPS..." - if git clone --branch "$BRANCH" "$REPO_URL_HTTPS" "$INSTALL_DIR"; then + if git clone --depth 1 --branch "$BRANCH" "$REPO_URL_HTTPS" "$INSTALL_DIR"; then log_success "Cloned via HTTPS" else log_error "Failed to clone repository"