Add support for SHA256 repositories

New input parameter to specify the git object format when initializing a
git repository.
This commit is contained in:
Elisei Roca 2025-04-05 11:11:19 +02:00
parent 85e6279cec
commit 488933c971
No known key found for this signature in database
GPG key ID: 9B47732BAA663196
8 changed files with 37 additions and 8 deletions

View file

@ -42,7 +42,7 @@ export interface IGitCommandManager {
): Promise<void>
getDefaultBranch(repositoryUrl: string): Promise<string>
getWorkingDirectory(): string
init(): Promise<void>
init(objectFormat?: string): Promise<void>
isDetached(): Promise<boolean>
lfsFetch(ref: string): Promise<void>
lfsInstall(): Promise<void>
@ -327,8 +327,13 @@ 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) {
args.push(`--object-format=${objectFormat}`)
}
args.push(this.workingDirectory)
await this.execGit(args)
}
async isDetached(): Promise<boolean> {