more unit tests and corresponding refactoring (#174)

This commit is contained in:
eric sciple 2020-03-02 11:33:30 -05:00 committed by GitHub
parent 096e927750
commit f219062370
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1049 additions and 305 deletions

View file

@ -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()