From ec05bd11337312882f8e281fab7a701a07419861 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 27 Jan 2023 11:03:23 -0800 Subject: [PATCH] try to set the origin before detecting pending chnages --- .../Azure.Sdk.Tools.TestProxy/Store/GitStore.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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 2b98bd5e054..d0870c96f86 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,7 +122,6 @@ public async Task Push(string pathToAssetsJson) { { throw GenerateInvokeException(SHAResult); } - SetOrigin(config); GitHandler.Run($"tag {generatedTagName}", config); GitHandler.Run($"push origin {generatedTagName}", config); @@ -173,6 +173,7 @@ public async Task Reset(string pathToAssetsJson) InitializeAssetsRepo(config); } + SetOrigin(config); var pendingChanges = DetectPendingChanges(config); if (pendingChanges.Length > 0) @@ -217,6 +218,8 @@ public async Task Reset(string pathToAssetsJson) await BreadCrumb.Update(config); } } + + HideOrigin(config); } /// @@ -249,16 +252,6 @@ public string[] DetectPendingChanges(GitAssetsConfiguration config) { SetSafeDirectory(config); - var a = Environment.GetEnvironmentVariable(GIT_COMMIT_OWNER_ENV_VAR); - var b = Environment.GetEnvironmentVariable(GIT_COMMIT_EMAIL_ENV_VAR); - - var preface = ""; - if (null != a && null != b) - { - preface = $"-c user.name =\"{a}\" -c user.email=\"{b}\" "; - } - - var run = $"{preface}status --porcelain"; if (!GitHandler.TryRun($"status --porcelain", config.AssetsRepoLocation.ToString(), out var diffResult)) { throw GenerateInvokeException(diffResult);