-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make the system installer always append GCM Core entries, not outright set/replace existing values (and fix a typo) #203
Conversation
Maybe |
Rather than set the helper to be _only_ GCM Core in the system configuration when called with `(un)configure --system`, we do what we are already doing in the user-case. We only append an empty ("") reset entry, and then the GCM full path entry. This means on uninstall of the standalone GCM (be that the system or user install), we restore the previous entry, always.
68a8155
to
364aeb3
Compare
string.IsNullOrWhiteSpace(currentValues[appIndex - 1])) | ||
{ | ||
// Clear the blank entry | ||
config.UnsetAll(helperKey, Constants.RegexPatterns.Empty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there are multiple empty entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what we can do here to identify a specific line in a config file, that matches the same value, using only git config
commands. Any ideas?
Add the --get-all and --add Git configuration commands, and use them in place of --get-regexp and --replace-all where applicable.
If we have empty helper entries after GCM, then we should attempt to reconfigure to put GCM back "at the front", since otherwise it's effectively being disabled by those subsequent empty entries.
Sorry @dscho, requesting yet another review.. |
Only clear the useHttpPath=true option on calls to unconfigure if the "manager-core" option is not present and we're in the system config on a Windows platform. This would be the case for the bundled GCM Core in Git for Windows, which we would break by removing this option.
Since --null means that each config entry terminates with a null character ('\0') we are left with one extra entry in the array after splitting the string. This is NOT a real entry and we shouldn't return it from the method.
7853e56
to
ba81146
Compare
Rather than set the helper to be only GCM Core in the system configuration when called with
(un)configure --system
, we do what we are already doing in the user-case.We only append an empty ("") reset entry, and then the GCM full path entry. This means on uninstall of the standalone GCM (be that the system or user install), we restore the previous entry, always.
Catch more existing config cases such as when another 'empty' entry is after GCM. We will now see this case and reconfigure ourselves to be exclusively 'in front'.
Also we are not that meta.. "Git Credential Manager
ManagerCore". Whoops.