From eb9dcad7e007cb96364b4e612799ce0ff736cb09 Mon Sep 17 00:00:00 2001 From: Yashwanth Anantharaju Date: Mon, 1 Jun 2026 11:35:58 -0400 Subject: Fix checkout init for SHA-256 repositories (#2439) * Fix checkout init for SHA-256 repositories * Remove unused object format result field --- src/git-command-manager.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/git-command-manager.ts') diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index f5ba40e..f1349ce 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -43,7 +43,7 @@ export interface IGitCommandManager { getDefaultBranch(repositoryUrl: string): Promise getSubmoduleConfigPaths(recursive: boolean): Promise getWorkingDirectory(): string - init(): Promise + init(objectFormat?: string): Promise isDetached(): Promise lfsFetch(ref: string): Promise lfsInstall(): Promise @@ -364,8 +364,14 @@ class GitCommandManager { return this.workingDirectory } - async init(): Promise { - await this.execGit(['init', this.workingDirectory]) + async init(objectFormat?: string): Promise { + const args = ['init'] + if (objectFormat === 'sha256') { + args.push('--object-format=sha256') + } + args.push(this.workingDirectory) + + await this.execGit(args) } async isDetached(): Promise { -- cgit v1.2.3