mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-06-17 18:36:24 +00:00
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:
parent
900f2210b1
commit
1cce3390c2
6 changed files with 282 additions and 7 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue