mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-01-16 00:26:16 +00:00
Merge 65f77605c0 into 0c366fd6a8
This commit is contained in:
commit
579dce1d99
10 changed files with 71 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ export interface IGitCommandManager {
|
|||
lfsInstall(): Promise<void>
|
||||
log1(format?: string): Promise<string>
|
||||
remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
|
||||
referenceAdd(reference: string): Promise<void>
|
||||
removeEnvironmentVariable(name: string): void
|
||||
revParse(ref: string): Promise<string>
|
||||
setEnvironmentVariable(name: string, value: string): void
|
||||
|
|
@ -401,6 +402,15 @@ class GitCommandManager {
|
|||
await this.execGit(['remote', 'add', remoteName, remoteUrl])
|
||||
}
|
||||
|
||||
async referenceAdd(alternateObjects: string): Promise<void> {
|
||||
const alternatePath = path.join(
|
||||
this.workingDirectory,
|
||||
'.git/objects/info/alternates'
|
||||
)
|
||||
core.info(`Adding a git alternate to reference repo at ${alternateObjects}`)
|
||||
await fs.promises.writeFile(alternatePath, `${alternateObjects}\n`)
|
||||
}
|
||||
|
||||
removeEnvironmentVariable(name: string): void {
|
||||
delete this.gitEnv[name]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue