From 913a70f1c8ab5b2c82e5f54a7f0f63f361aaaaf6 Mon Sep 17 00:00:00 2001 From: Thomas Jespersen Date: Thu, 21 May 2026 19:21:40 +0200 Subject: [PATCH] Stop format command from converting local clones to shallow clones --- developer-cli/Utilities/GitHelper.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/developer-cli/Utilities/GitHelper.cs b/developer-cli/Utilities/GitHelper.cs index 008bad1c8..b543e811d 100644 --- a/developer-cli/Utilities/GitHelper.cs +++ b/developer-cli/Utilities/GitHelper.cs @@ -142,11 +142,10 @@ public static void FetchFromOrigin() } // Returns relative paths (relative to solutionDirectory) of .cs files changed compared to - // origin/main. Fetches origin/main first so this works on shallow CI clones; the fetch is - // best-effort and silent on failure. + // origin/main. Relies on the caller's environment to keep origin/main reasonably current: + // CI checkouts in this repo use fetch-depth: 0 and local developers fetch on the usual cadence. public static string[] GetChangedCsFilesInDirectory(string solutionDirectory) { - ProcessHelper.StartProcess("git fetch origin main --depth=1", Configuration.SourceCodeFolder, true, exitOnError: false); var output = ProcessHelper.StartProcess("git diff --name-only origin/main -- \"*.cs\"", Configuration.SourceCodeFolder, true, exitOnError: false); if (string.IsNullOrWhiteSpace(output)) return [];