From cbd0cefb9cc87744286fde23632860354f5c62ee Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Thu, 15 Feb 2024 10:01:27 -0500 Subject: [PATCH] GVFSVerb: Use OAuth credentials by default To more rapidly adopt OAuth tokens, set that as the default for GVFS repos. This will update on mount, so all users will update to this mode when they upgrade to a version including this commit. This may cause some initial frustration as the first time I ran a fetch in OAuth mode my local clone had a failure with GCM and defaulted to username/password checks over command line. The second fetch worked just fine, though. --- GVFS/GVFS/CommandLine/GVFSVerb.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GVFS/GVFS/CommandLine/GVFSVerb.cs b/GVFS/GVFS/CommandLine/GVFSVerb.cs index 8449b5bab..cd74600e4 100644 --- a/GVFS/GVFS/CommandLine/GVFSVerb.cs +++ b/GVFS/GVFS/CommandLine/GVFSVerb.cs @@ -312,6 +312,11 @@ public static bool TrySetRequiredGitConfigSettings(Enlistment enlistment) // Disable the builtin FS Monitor in case it was enabled globally. { "core.useBuiltinFSMonitor", "false" }, + + // Set the GCM credential method to use OAuth tokens. + // See https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/configuration.md#credentialazreposcredentialtype + // for more information. + { "credential.azreposCredentialType", "oauth" }, }; if (!TrySetConfig(enlistment, requiredSettings, isRequired: true))