mirror of
https://github.com/yangskyboxlabs/action-checkout.git
synced 2025-12-13 21:18:25 +01:00
Add objectFormat setting to allow init()ing a repo with sha256
This commit is contained in:
parent
9a9194f871
commit
16bbbf6c3a
2 changed files with 12 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ export interface IGitCommandManager {
|
||||||
): Promise<void>
|
): Promise<void>
|
||||||
getDefaultBranch(repositoryUrl: string): Promise<string>
|
getDefaultBranch(repositoryUrl: string): Promise<string>
|
||||||
getWorkingDirectory(): string
|
getWorkingDirectory(): string
|
||||||
init(): Promise<void>
|
init(options?: { objectFormat?: string }): Promise<void>
|
||||||
isDetached(): Promise<boolean>
|
isDetached(): Promise<boolean>
|
||||||
lfsFetch(ref: string): Promise<void>
|
lfsFetch(ref: string): Promise<void>
|
||||||
lfsInstall(): Promise<void>
|
lfsInstall(): Promise<void>
|
||||||
|
|
@ -327,8 +327,12 @@ class GitCommandManager {
|
||||||
return this.workingDirectory
|
return this.workingDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
async init(): Promise<void> {
|
async init(options?: { objectFormat?: string }): Promise<void> {
|
||||||
await this.execGit(['init', this.workingDirectory])
|
await this.execGit([
|
||||||
|
'init',
|
||||||
|
...(options?.objectFormat ? ["--object-format", options.objectFormat] : []),
|
||||||
|
this.workingDirectory
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
async isDetached(): Promise<boolean> {
|
async isDetached(): Promise<boolean> {
|
||||||
|
|
|
||||||
|
|
@ -118,4 +118,9 @@ export interface IGitSourceSettings {
|
||||||
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
|
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
|
||||||
*/
|
*/
|
||||||
githubServerUrl: string | undefined
|
githubServerUrl: string | undefined
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object format used for the repo, if it is not default
|
||||||
|
*/
|
||||||
|
objectFormat: string | undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue