more unit tests and corresponding refactoring (#174)
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user