Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 20.04 on WSL for Windows 11 gives error on git clone if Windows %PATH% has special/invalid characters #1601

Open
bartpinto opened this issue Apr 26, 2024 · 0 comments

Comments

@bartpinto
Copy link

Ubuntu 20.04 on WSL for Windows 11 gives error on git clone if Windows %PATH% has special/invalid characters

git version 2.43.2
Linux DESKTOP-0PHQ4UG 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

Invalid PATH entry (CRLF):
C:\Program Files (x86)\Microsoft Visual
Studio\2019\BuildTools\MSBuild\Current\Bin

Relevant gitconfig:
[credential]
helper = /mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe
azreposCredentialType = oauth
msauthUseBroker = true
msauthUseDefaultAccount = true
[credential "https://dev.azure.com"]
useHttpPath = true
[safe]
directory = *
[credential "azrepos:org/msazuredev"]
azureAuthority = https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47

Error message:
Cloning into 'nc-labs'...

Unhandled Exception: System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2)
at GitCredentialManager.EnvironmentBase.TryLocateExecutable(String program, ICollection`1 pathsToIgnore, String& path)
at GitCredentialManager.EnvironmentBase.TryLocateExecutable(String program, String& path)
at GitCredentialManager.EnvironmentExtensions.LocateExecutable(IEnvironment environment, String program)
at GitCredentialManager.CommandContext.GetGitPath(IEnvironment environment, IFileSystem fileSystem, ITrace trace)
at GitCredentialManager.CommandContext..ctor()
at GitCredentialManager.Program.AppMain(Object o)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)

Expected Result:
Improve error handling or messaging, "Check your Windows %PATH% for invalid "<", ">", "|" or special characters."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@bartpinto and others