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

exit code does not indicate failure when credentials are not found #440

Closed
chuckries opened this issue Sep 3, 2021 · 1 comment · Fixed by #441
Closed

exit code does not indicate failure when credentials are not found #440

chuckries opened this issue Sep 3, 2021 · 1 comment · Fixed by #441
Labels
bug A bug in Git Credential Manager

Comments

@chuckries
Copy link

gcm-core.exe appears to always return 0 even if the credentials were not found. This does not match the behavior that legacy gcm did and it makes leveraging it outside of git scenarios more difficult.

D:\VisualStudio\2022\main\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core>git-credential-manager-core.exe get
protocol=https
host=github.com

fatal: Cannot prompt because user interactivity has been disabled.

D:\VisualStudio\2022\main\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core>echo %ERRORLEVEL%
0

D:\VisualStudio\2022\main\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core>git-credential-manager.exe get
protocol=https
host=github.com

Logon failed, use ctrl+c to cancel basic credential prompt.

D:\VisualStudio\2022\main\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core>echo %ERRORLEVEL%
-1
D:\VisualStudio\2022\main\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core>git-credential-manager-core.exe --version
2.0.475+27fbadca1d
@mjcheetham mjcheetham added the bug A bug in Git Credential Manager label Sep 6, 2021
@mjcheetham
Copy link
Collaborator

Ah yes.. this change would have come about when we moved to using System.CommandLine for command handling.
Got a PR up to return -1 on exception, such as when interaction has been disabled #441

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

Successfully merging a pull request may close this issue.

2 participants