Repository navigation
Conversation
When several repositories trigger an Entra sign-in at once it is hard to tell which request a prompt belongs to. Capture the remote (host/path) in an ambient AuthPromptContext and show it in the default-account prompt (GUI and console). The stub ProgressWindow that parents the broker sign-in now also shows the remote and the working directory of the requesting Git process. Only the Azure Repos provider sets the context for now; other providers are unchanged. Assisted-by: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2463.
When several repositories (or worktrees) need a sign-in at the same time, the
prompts give no hint which request they belong to, so it is easy to dismiss or
accept one blindly.
This adds an ambient
AuthPromptContextthat the Azure Repos provider sets tohost/pathbefore it asks Entra for a token. It is then shown in:For: <remote>) and theconsole prompt (
Continue with current account (x) for <remote>?);ProgressWindowthat parents the Windows broker sign-in, which nowalso shows the working directory of the Git process that requested the
credential (
Requested from: <cwd>).The context is an
AsyncLocal, so concurrent requests in one process do not seeeach other's value. If no context is set (any other provider), the prompts look
exactly as before; the progress window then only shows the working directory.
Scope
for. The working directory is the closest available signal. Showing the process
chain would need per-platform work and could be a follow-up.
Testing
AuthPromptContextTests(flow into awaited work, isolation betweenconcurrent flows, the progress window text with and without a request,
DefaultAccountViewModel.HasContext).dotnet test git-credential-manager.slnx,with
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1because the sixTrace2MessageTests.BuildTimeSpancases fail under a decimal-comma culture on my machine):all projects pass.
ProgressWindowandDefaultAccountViewwith sample data(short and very long remotes and paths) to check that the text wraps and the
windows grow as expected.
platform-neutral, but I only ran Windows), and the progress window during a real
broker sign-in through
git-credential-manager.exe.🤖 Generated with Claude Code