Fix checkout init for SHA-256 repositories (#2439)

* Fix checkout init for SHA-256 repositories

* Remove unused object format result field
This commit is contained in:
Yashwanth Anantharaju
2026-06-01 11:35:58 -04:00
committed by GitHub
parent 900f2210b1
commit 1cce3390c2
6 changed files with 282 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ export interface IGitCommandManager {
getDefaultBranch(repositoryUrl: string): Promise<string>
getSubmoduleConfigPaths(recursive: boolean): Promise<string[]>
getWorkingDirectory(): string
init(): Promise<void>
init(objectFormat?: string): Promise<void>
isDetached(): Promise<boolean>
lfsFetch(ref: string): Promise<void>
lfsInstall(): Promise<void>
@@ -364,8 +364,14 @@ class GitCommandManager {
return this.workingDirectory
}
async init(): Promise<void> {
await this.execGit(['init', this.workingDirectory])
async init(objectFormat?: string): Promise<void> {
const args = ['init']
if (objectFormat === 'sha256') {
args.push('--object-format=sha256')
}
args.push(this.workingDirectory)
await this.execGit(args)
}
async isDetached(): Promise<boolean> {