diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 1a4156c704..cd8f744160 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -613,6 +613,26 @@ test_expect_success 'renaming to bogus section is rejected' ' test_must_fail git config --rename-section branch.zwei "bogus name" ' +test_expect_failure 'renaming a section with a long line' ' + { + printf "[b]\\n" && + printf " c = d %1024s [a] e = f\\n" " " && + printf "[a] g = h\\n" + } >y && + git config -f y --rename-section a xyz && + test_must_fail git config -f y b.e +' + +test_expect_failure 'renaming an embedded section with a long line' ' + { + printf "[b]\\n" && + printf " c = d %1024s [a] [foo] e = f\\n" " " && + printf "[a] g = h\\n" + } >y && + git config -f y --rename-section a xyz && + test_must_fail git config -f y foo.e +' + cat >> .git/config << EOF [branch "zwei"] a = 1 [branch "vier"] EOF