check() {
echo "$2" >expected
git config --get "$1" >actual
- git diff actual expected
+ test_cmp actual expected
}
test_expect_success 'modify same key' '
check 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 &&
+ check "$SECTION" bar
+'
+
test_done