summaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-04-30 14:46:46 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-04-30 14:46:46 -0700
commit563b3527b41a978eeef77d9426be460013c35d88 (patch)
tree5ca590f5d68d5b74b41451403a34220f2d30d455 /t/t1300-repo-config.sh
parentThe seventh batch of topics graduated to 'master' (diff)
parentconfig: reject bogus section names for --rename-section (diff)
downloadtgif-563b3527b41a978eeef77d9426be460013c35d88.tar.xz
Merge branch 'jk/maint-config-bogus-section'
"git config --rename-section" to rename an existing section into a bogus one did not check the new name. By Jeff King * jk/maint-config-bogus-section: config: reject bogus section names for --rename-section
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 36e227b3bb..a477453e2e 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -550,6 +550,14 @@ EOF
test_expect_success "rename succeeded" "test_cmp expect .git/config"
+test_expect_success 'renaming empty section name is rejected' '
+ test_must_fail git config --rename-section branch.zwei ""
+'
+
+test_expect_success 'renaming to bogus section is rejected' '
+ test_must_fail git config --rename-section branch.zwei "bogus name"
+'
+
cat >> .git/config << EOF
[branch "zwei"] a = 1 [branch "vier"]
EOF