From f640f381022edc660fcd81ad1acadd6aaef03507 Mon Sep 17 00:00:00 2001 From: zinglax Date: Wed, 4 Jun 2025 09:44:05 -0400 Subject: [PATCH] Adding --depth=1 to fetchs to save time See https://github.com/anthropics/claude-code-action/issues/52 --- src/github/operations/branch.ts | 4 ++-- src/github/utils/local-git.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github/operations/branch.ts b/src/github/operations/branch.ts index e02e884..6726fb6 100644 --- a/src/github/operations/branch.ts +++ b/src/github/operations/branch.ts @@ -52,7 +52,7 @@ export async function setupBranch( ); // Check out the base branch and let Claude create branches as needed - await $`git fetch origin ${sourceBranch}`; + await $`git fetch origin --depth=1 ${sourceBranch}`; await $`git checkout ${sourceBranch}`; await $`git pull origin ${sourceBranch}`; @@ -99,7 +99,7 @@ export async function setupBranch( // Ensure we have the latest version of the source branch console.log(`Fetching latest ${sourceBranch}...`); - await $`git fetch origin ${sourceBranch}`; + await $`git fetch origin --depth=1 ${sourceBranch}`; // Checkout the source branch console.log(`Checking out ${sourceBranch}...`); diff --git a/src/github/utils/local-git.ts b/src/github/utils/local-git.ts index 2b36f2b..188d33c 100644 --- a/src/github/utils/local-git.ts +++ b/src/github/utils/local-git.ts @@ -85,7 +85,7 @@ export async function branchHasChanges( */ export async function fetchBranch(branchName: string): Promise { try { - await $`git fetch origin ${branchName}`; + await $`git fetch origin --depth=1 ${branchName}`; return true; } catch (error) { console.log(