From 684bbf983233d1341d533f6fe471109f385c631a Mon Sep 17 00:00:00 2001 From: eric sciple Date: Mon, 2 Mar 2020 11:33:30 -0500 Subject: more unit tests and corresponding refactoring (#174) --- src/git-command-manager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/git-command-manager.ts') diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 74489c2..2b0d054 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -26,6 +26,7 @@ export interface IGitCommandManager { lfsInstall(): Promise log1(): Promise remoteAdd(remoteName: string, remoteUrl: string): Promise + setEnvironmentVariable(name: string, value: string): void tagExists(pattern: string): Promise tryClean(): Promise tryConfigUnset(configKey: string): Promise @@ -34,7 +35,7 @@ export interface IGitCommandManager { tryReset(): Promise } -export async function CreateCommandManager( +export async function createCommandManager( workingDirectory: string, lfs: boolean ): Promise { @@ -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 { const output = await this.execGit(['tag', '--list', pattern]) return !!output.stdout.trim() -- cgit v1.2.3