From c31d3a8f52d8656dd9f5cd569536b0f363ef36b3 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 27 Jan 2023 10:29:39 -0800 Subject: [PATCH] try making the status include the user and email --- .../Azure.Sdk.Tools.TestProxy/Store/GitStore.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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..2b98bd5e054 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Store/GitStore.cs @@ -249,7 +249,17 @@ public string[] DetectPendingChanges(GitAssetsConfiguration config) { SetSafeDirectory(config); - if (!GitHandler.TryRun("status --porcelain", config.AssetsRepoLocation.ToString(), out var diffResult)) + 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); }