mirror of
https://github.com/actions/checkout.git
synced 2025-06-23 15:46:10 +02:00
Merge 65f77605c0
into 09d2acae67
This commit is contained in:
commit
2e696d95b4
10 changed files with 71 additions and 1 deletions
|
@ -48,6 +48,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
|
||||
|
@ -364,6 +365,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