mirror of
https://github.com/actions/checkout.git
synced 2025-04-19 17:16:46 +00:00
more unit tests and corresponding refactoring (#174)
This commit is contained in:
parent
096e927750
commit
f219062370
14 changed files with 1049 additions and 305 deletions
|
@ -26,6 +26,7 @@ export interface IGitCommandManager {
|
|||
lfsInstall(): Promise<void>
|
||||
log1(): Promise<void>
|
||||
remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
|
||||
setEnvironmentVariable(name: string, value: string): void
|
||||
tagExists(pattern: string): Promise<boolean>
|
||||
tryClean(): Promise<boolean>
|
||||
tryConfigUnset(configKey: string): Promise<boolean>
|
||||
|
@ -34,7 +35,7 @@ export interface IGitCommandManager {
|
|||
tryReset(): Promise<boolean>
|
||||
}
|
||||
|
||||
export async function CreateCommandManager(
|
||||
export async function createCommandManager(
|
||||
workingDirectory: string,
|
||||
lfs: boolean
|
||||
): Promise<IGitCommandManager> {
|
||||
|
@ -207,6 +208,10 @@ class GitCommandManager {
|
|||
await this.execGit(['remote', 'add', remoteName, remoteUrl])
|
||||
}
|
||||
|
||||
setEnvironmentVariable(name: string, value: string): void {
|
||||
this.gitEnv[name] = value
|
||||
}
|
||||
|
||||
async tagExists(pattern: string): Promise<boolean> {
|
||||
const output = await this.execGit(['tag', '--list', pattern])
|
||||
return !!output.stdout.trim()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue