config: reject bogus section names for --rename-section
authorJeff King <peff@peff.net>
Thu, 26 Apr 2012 01:47:14 +0000 (21:47 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Apr 2012 04:19:06 +0000 (21:19 -0700)
commit94a35b1aea88f1ad882cdd111e01410fb6d3eb46
tree4157f0206ea05dcd97c62a0af8dc3ddc76a1fcbc
parentfdec2eb8ebbf995a77e2ab9971565c792b52944a
config: reject bogus section names for --rename-section

You can feed junk to "git config --rename-section", which
will result in a config file that git will not even parse
(so you cannot fix it with git-config). We already have
syntactic sanity checks when setting a variable; let's do
the same for section names.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
t/t1300-repo-config.sh