Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

git config problem with strange config files

From: Peter Oberndorfer <hidden>
Date: 2016-06-15 22:44:02

Hi,

In case of a strange .git/config file "git config key value" can create a 
bogus config entry, where one old value is wrong and the new value resides in 
the wrong section until the config file is fixed up by hand

The attached test config has a trailing tab in the last line
and no newline after that.
When git config is run the new section name is placed directly after the 
trailing tab, which corrupts the old value.

To reproduce  the error do the following:

mkdir git_test_config && cd git_test_config
git init
<copy the attached config file to .git/config>
git config section2.key bar
git config --get section2.key
-> returns nothing
git config --get section.key
-> foo [section2]
-> error: More than one value for the key section.key: bar

i tried to make a test out of this but i failed to create a config file 
without a trailing newline using here documents :-(

Tested using v1.5.4.rc2 and v1.5.4-rc2-6-gab11903

Greetings Peter

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help