| test_description='Test wacky input to git config' |
| printf " key = foo") >.git/config |
| git config --get "$1" >actual 2>&1 |
| test_expect_success 'modify same key' ' |
| git config section.key bar && |
| test_expect_success 'add key in same section' ' |
| git config section.other bar && |
| test_expect_success 'add key in different section' ' |
| git config section2.key bar && |
| SECTION="test.q\"s\\sq'sp e.key" |
| test_expect_success 'make sure git config escapes section names properly' ' |
| git config "$SECTION" bar && |
| LONG_VALUE=$(printf "x%01021dx a" 7) |
| test_expect_success 'do not crash on special long config line' ' |
| git config section.key "$LONG_VALUE" && |
| check section.key "$LONG_VALUE" |