mirror of
https://github.com/actions/checkout.git
synced 2026-01-19 14:38:53 +08:00
Add support for SHA256 repositories
New input parameter to specify the git object format when initializing a git repository.
This commit is contained in:
parent
85e6279cec
commit
488933c971
8 changed files with 37 additions and 8 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue