Git-credential-manager-for-windows: Does not correctly handle boolean configuration options

Created on 6 Oct 2016  路  3Comments  路  Source: microsoft/Git-Credential-Manager-for-Windows

v1.7.0 seems to introduce a bug, wherein configuration options set in config files are not honored.

(After much swearing) I tracked this down to the following block of code in Cli-Shared/Program.cs, Program.TryReadBoolean:

            string valueString = null;
            if ((!string.IsNullOrWhiteSpace(environKey)
                    && envars.TryGetValue(environKey, out valueString))
                || (!string.IsNullOrWhiteSpace(valueString)
                    && config.TryGetEntry(ConfigPrefix, operationArguments.QueryUri, configKey, out entry)))
            {
                Git.Trace.WriteLine($"{configKey} = '{entry.Value}'.");
                valueString = entry.Value;
            }

On the 4th line of that block, I believe that it should say || (!string.IsNullOrWhiteSpace(configKey).

I made this change and now GCMW works again for me (I require useHttpPath=true in my config, otherwise I may not have noticed).

bug

All 3 comments

Thanks for that. Nothing like a bug report with the suggested fix. The only thing better would have been a pull request with the fix, but it's so trivial I'm happy to do that for you.

Thanks again 馃槂

This is really a breaking change and it would be helpful if you could release a hotfix ASAP. I had to roll back to 1.6.1 due to this issue. I use multiple GitHub accounts for work and personal projects, so it is very important that credentials are stored properly per repo. Version 1.7 simply stores all credentials as git:https://github.com. (I'm also using the useHttpPath = true setting).

EDIT: I re-read my comment and I didn't like how it sounded. Instead of saying you should, I'm asking if you would nicely, pretty please. Sorry for the tone.

@kiliman please note that you could help by preparing a Pull Request. This would make the maintainer's task much easier.

Was this page helpful?
0 / 5 - 0 ratings