Disallow empty section and variable names
authorLibor Pechacek <lpechacek@suse.cz>
Tue, 1 Feb 2011 07:13:47 +0000 (08:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Feb 2011 23:19:46 +0000 (15:19 -0800)
It is possible to break your repository config by creating an invalid key. The
config parser in turn chokes on it:

$ git init
Initialized empty Git repository in /tmp/gittest/.git/
$ git config .foo false
$ git config core.bare
fatal: bad config file line 6 in .git/config

This patch makes git-config reject keys which start or end with a dot and adds
tests for these cases.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found