diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs index c2b6deb87cc..7c2c8440667 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs @@ -97,6 +97,7 @@ public async Task Push(string pathToAssetsJson) { return; } + SetOrigin(config); var pendingChanges = DetectPendingChanges(config); var generatedTagName = config.TagPrefix; @@ -121,19 +122,20 @@ public async Task Push(string pathToAssetsJson) { { throw GenerateInvokeException(SHAResult); } - SetOrigin(config); GitHandler.Run($"tag {generatedTagName}", config); GitHandler.Run($"push origin {generatedTagName}", config); - HideOrigin(config); } catch(GitProcessException e) { + HideOrigin(config); throw GenerateInvokeException(e.Result); } await UpdateAssetsJson(generatedTagName, config); await BreadCrumb.Update(config); } + + HideOrigin(config); } /// @@ -173,6 +175,7 @@ public async Task Reset(string pathToAssetsJson) InitializeAssetsRepo(config); } + SetOrigin(config); var pendingChanges = DetectPendingChanges(config); if (pendingChanges.Length > 0) @@ -208,6 +211,7 @@ public async Task Reset(string pathToAssetsJson) } catch(GitProcessException e) { + HideOrigin(config); throw GenerateInvokeException(e.Result); } @@ -217,6 +221,8 @@ public async Task Reset(string pathToAssetsJson) await BreadCrumb.Update(config); } } + + HideOrigin(config); } /// @@ -249,7 +255,7 @@ public string[] DetectPendingChanges(GitAssetsConfiguration config) { SetSafeDirectory(config); - if (!GitHandler.TryRun("status --porcelain", config.AssetsRepoLocation.ToString(), out var diffResult)) + if (!GitHandler.TryRun($"status --porcelain", config.AssetsRepoLocation.ToString(), out var diffResult)) { throw GenerateInvokeException(diffResult); } @@ -309,16 +315,18 @@ public void CheckoutRepoAtConfig(GitAssetsConfiguration config) // The -c advice.detachedHead=false removes the verbose detatched head state // warning that happens when syncing sparse-checkout to a particular Tag GitHandler.Run($"-c advice.detachedHead=false checkout {config.Tag}", config); - HideOrigin(config); // the first argument, the key, is the path to the assets json relative location // the second argument, the value, is the value we want to set the json elative location to // the third argument is a function argument that resolves what to do in the "update" case. If the key already exists // update the tag to what we just checked out. Assets.AddOrUpdate(config.AssetsJsonRelativeLocation.ToString(), config.Tag, (key, oldValue) => config.Tag); + + HideOrigin(config); } catch(GitProcessException e) { + HideOrigin(config); throw GenerateInvokeException(e.Result); } }