From 674db27f6e1fdbe16cd77a4673677333493c4327 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 1 Oct 2026 12:18:06 +0200 Subject: [PATCH] fix(worker): keep Git Credential Manager from prompting during company fetch/push --- src/ClaudeDo.Worker/AzureDevOps/AzureDevOpsClient.cs | 5 +++-- .../AzureDevOps/AzureDevOpsClientTests.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ClaudeDo.Worker/AzureDevOps/AzureDevOpsClient.cs b/src/ClaudeDo.Worker/AzureDevOps/AzureDevOpsClient.cs index a852fd2c..841d3aea 100644 --- a/src/ClaudeDo.Worker/AzureDevOps/AzureDevOpsClient.cs +++ b/src/ClaudeDo.Worker/AzureDevOps/AzureDevOpsClient.cs @@ -56,12 +56,13 @@ public sealed class AzureDevOpsClient public static string AuthHeaderValue(string pat) => "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(":" + pat)); /// - /// Environment for a git network call: never prompt (a background process would hang), and hand the PAT + /// Environment for a git network call: never prompt — neither the terminal nor Git Credential Manager's GUI + /// (a background process would hang on either) — and hand the PAT /// over as http.extraHeader via GIT_CONFIG_* so it never shows up in a command line. /// public static IReadOnlyDictionary GitAuthEnv(string? pat) { - var env = new Dictionary { ["GIT_TERMINAL_PROMPT"] = "0" }; + var env = new Dictionary { ["GIT_TERMINAL_PROMPT"] = "0", ["GCM_INTERACTIVE"] = "never" }; if (!string.IsNullOrEmpty(pat)) { env["GIT_CONFIG_COUNT"] = "1"; diff --git a/tests/ClaudeDo.Worker.Tests/AzureDevOps/AzureDevOpsClientTests.cs b/tests/ClaudeDo.Worker.Tests/AzureDevOps/AzureDevOpsClientTests.cs index 4956d1b7..8bcc54e7 100644 --- a/tests/ClaudeDo.Worker.Tests/AzureDevOps/AzureDevOpsClientTests.cs +++ b/tests/ClaudeDo.Worker.Tests/AzureDevOps/AzureDevOpsClientTests.cs @@ -61,6 +61,7 @@ public sealed class AzureDevOpsClientTests : IDisposable var env = AzureDevOpsClient.GitAuthEnv("geheim"); Assert.Equal("0", env["GIT_TERMINAL_PROMPT"]); + Assert.Equal("never", env["GCM_INTERACTIVE"]); Assert.Equal("1", env["GIT_CONFIG_COUNT"]); Assert.Equal("http.extraHeader", env["GIT_CONFIG_KEY_0"]); Assert.Equal("Authorization: Basic OmdlaGVpbQ==", env["GIT_CONFIG_VALUE_0"]);