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

boolean config parsing fails with integers in some cases #5555

Closed
ehuss opened this issue Jun 12, 2020 · 3 comments
Closed

boolean config parsing fails with integers in some cases #5555

ehuss opened this issue Jun 12, 2020 · 3 comments

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 12, 2020

In some situations, the config parsing code will fail on boolean values that use integers (0 or 1).

Reproduction steps

Add to .gitconfig:

[core]
    logAllRefUpdates = 1

Then, perform some operation in a bare repo (such as adding a new commit). It will fail with failed to map '1'.

Expected behavior

All boolean config values should support integers.

Actual behavior

Some boolean config values fail to parse.

Version of libgit2 (release number or SHA1)

86b8549

Operating system(s) tested

macOS

Notes

The issue is that some functions (like git_config_lookup_map_value) call the low-level git__parse_bool which does not support integers. I think, instead, they should be using git_config_parse_bool which handles integers.

csware added a commit to csware/libgit2 that referenced this issue Sep 9, 2020
…d git_config_lookup_map_value

(fixes issue libgit2#5555)

Signed-off-by: Sven Strickroth <email@cs-ware.de>
@ethomson
Copy link
Member

ethomson commented Oct 4, 2020

Fixed via #5626 - thanks @csware!

@ethomson ethomson closed this as completed Oct 4, 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

No branches or pull requests

3 participants
@ehuss @ethomson and others