Skip to content

Commit c0fbe95

Browse files
miya789ldennington
andcommitted
credentialstore: add error about cache windows
Co-authored-by: Lessley Dennington <[email protected]>
1 parent 5a8ba50 commit c0fbe95

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/shared/Core/CredentialStore.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ private static void AppendAvailableStoreList(StringBuilder sb)
152152
Environment.NewLine, StoreNames.Gpg);
153153
}
154154

155-
sb.AppendFormat(" {1,-13} : Git's in-memory credential cache{0}",
156-
Environment.NewLine, StoreNames.Cache);
155+
if (!PlatformUtils.IsWindows())
156+
{
157+
sb.AppendFormat(" {1,-13} : Git's in-memory credential cache{0}",
158+
Environment.NewLine, StoreNames.Cache);
159+
}
157160

158161
sb.AppendFormat(" {1,-13} : store credentials in plain-text files (UNSECURE){0}",
159162
Environment.NewLine, StoreNames.Plaintext);
@@ -286,6 +289,15 @@ private void ValidateGpgPass(out string storeRoot, out string execPath)
286289

287290
private void ValidateCredentialCache(out string options)
288291
{
292+
if (PlatformUtils.IsWindows())
293+
{
294+
throw new Exception(
295+
$"Can not use the '{StoreNames.Cache}' credential store on Windows due to lack of UNIX socket support in Git for Windows." +
296+
Environment.NewLine +
297+
$"See {Constants.HelpUrls.GcmCredentialStores} for more information."
298+
);
299+
}
300+
289301
// allow for --timeout and other options
290302
if (!_context.Settings.TryGetSetting(
291303
Constants.EnvironmentVariables.GcmCredCacheOptions,

0 commit comments

Comments
 (0)