From 9109f179dfddcc95735cc77d9e04c45d03cb41cd Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sat, 8 Oct 2022 20:04:25 +0200 Subject: [PATCH] Added explanatory message for unsupported "manager-core" --- .../gitnuro/credentials/HttpCredentialsProvider.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/credentials/HttpCredentialsProvider.kt b/src/main/kotlin/com/jetpackduba/gitnuro/credentials/HttpCredentialsProvider.kt index 75bf958..ee15760 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/credentials/HttpCredentialsProvider.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/credentials/HttpCredentialsProvider.kt @@ -201,10 +201,15 @@ class HttpCredentialsProvider @AssistedInject constructor( val genericCredentialHelper = config.getString("credential", null, "helper") val uriSpecificCredentialHelper = config.getString("credential", hostWithProtocol, "helper") - val credentialHelperPath = uriSpecificCredentialHelper ?: genericCredentialHelper ?: return null + var credentialHelperPath = uriSpecificCredentialHelper ?: genericCredentialHelper ?: return null if(credentialHelperPath == "cache" || credentialHelperPath == "store") { - throw NotSupportedHelper("Invalid credentials: \"$credentialHelperPath\" is not yet supported") + throw NotSupportedHelper("Invalid credentials helper: \"$credentialHelperPath\" is not yet supported") + } + + // TODO Try to use "git-credential-manager-core" when "manager-core" is detected. Works for linux but requires testing for mac/windows + if(credentialHelperPath == "manager-core") { + throw NotSupportedHelper("Invalid credentials helper \"$credentialHelperPath\". Please specify the full path of Git Credential Manager in your .gitconfig") } // Use getString instead of getBoolean as boolean has a default value by we want null if the config field is not set