From 416f74d525e5b4cc4bc72ad811d085799eecc037 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 02:52:30 +0000 Subject: [PATCH] Add shallow fetch to improve performance for large repositories This change adds `--depth=1` to git fetch operations to perform shallow fetches instead of full history downloads. This significantly reduces checkout time for large repositories as reported in issue #52. Changes: - Line 55: Added --depth=1 to PR branch fetch - Line 102: Added --depth=1 to new branch fetch Fixes #52 Co-authored-by: ashwin-ant --- src/github/operations/branch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/github/operations/branch.ts b/src/github/operations/branch.ts index 97bf6e67..1998ed85 100644 --- a/src/github/operations/branch.ts +++ b/src/github/operations/branch.ts @@ -51,8 +51,8 @@ export async function setupBranch( const branchName = prData.headRefName; - // Execute git commands to checkout PR branch - await $`git fetch origin ${branchName}`; + // Execute git commands to checkout PR branch (shallow fetch for performance) + await $`git fetch origin --depth=1 ${branchName}`; await $`git checkout ${branchName}`; console.log(`Successfully checked out PR branch for PR #${entityNumber}`); @@ -98,8 +98,8 @@ export async function setupBranch( sha: currentSHA, }); - // Checkout the new branch - await $`git fetch origin ${newBranch}`; + // Checkout the new branch (shallow fetch for performance) + await $`git fetch origin --depth=1 ${newBranch}`; await $`git checkout ${newBranch}`; console.log(