config_file: Don't crash on options without a section#4750
config_file: Don't crash on options without a section#4750pks-t merged 5 commits intolibgit2:masterfrom
Conversation
|
Nice find - but git seems to parse configuration values without a section just fine. I think that actually we should: |
|
Huh, I found that if I added That said, it doesn't seem to stop parsing at the error, which I believe this patch does. I'm happy to accept your proposal. |
|
I suspected it might be a warning with some commands. ( Would you mind throwing a comment in that suggests that we should warn too? Once warnings land we can wire it up. Thanks! |
|
I'm not sure at all what happens in case we parse a config key without section. Could you please add a test that demonstrates that we do not fail at another place and that demonstrates what's expected to happen? |
|
Thanks for your fix and the test! |
Found via fuzzing.