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

Fix errors with 'git-credential-manager-core configure' with empty config #163

Merged
merged 3 commits into from
Sep 11, 2020

Conversation

derrickstolee
Copy link
Contributor

Resolves #161. The failures were due to subtleties when working without any credential.helper values in any level of config. This is typical for a fresh install on a Linux machine, but never happens with Git for Windows. Git on macOS might also come pre-loaded with this config.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
For some situations, the key-value pairs we split from the response of
'git config' do not have two elements. Be careful to check the length
before returning the value. If the length is not two, then this is an
invalid key-value pair so skip that entry.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
1. When we re-set the configuration, we pass an empty value to clear the
existing values. However, that only works if we quote around the empty
value. Otherwise, Git does not "see" a value argument.

2. If there is no configuration for a given key, the exit codes for 'git
config' change. See the documentation [1] for full details. For now, be
careful about exit codes 1 and 5, when appropriate.

[1] https://git-scm.com/docs/git-config

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Copy link
Collaborator

@mjcheetham mjcheetham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@derrickstolee
Copy link
Contributor Author

/azp run GCM-PR

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@derrickstolee derrickstolee merged commit 51089a2 into git-ecosystem:master Sep 11, 2020
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

Successfully merging this pull request may close these issues.

Linux: failures in "configure" subcommand
2 participants