summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJharrod LaFon <jlafon@eyesopen.com>2013-08-19 16:26:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-08-19 20:47:56 (GMT)
commit4b05440283350ec3b01afabe847d9ce5cf4cbdb7 (patch)
treed07d7b4e2fcbfa3d9cb18df7e5110bcfbfc50ff4 /t
parentf59bebb78edb26e4f66c2754bc4d168c5d4ebb4a (diff)
downloadgit-4b05440283350ec3b01afabe847d9ce5cf4cbdb7.zip
git-4b05440283350ec3b01afabe847d9ce5cf4cbdb7.tar.gz
git-4b05440283350ec3b01afabe847d9ce5cf4cbdb7.tar.bz2
avoid segfault on submodule.*.path set to an empty "true"
Git fails due to a segmentation fault if a submodule path is empty. Here is an example .gitmodules that will cause a segmentation fault: [submodule "foo-module"] path url = http://host/repo.git $ git status Segmentation fault (core dumped) This is because the parsing of "submodule.*.path" is not prepared to see a value-less "true" and assumes that the value is always non-NULL (parsing of "ignore" has the same problem). Fix it by checking the NULL-ness of value and complain with config_error_nonbool(). Signed-off-by: Jharrod LaFon <jlafon@eyesopen.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 2683cba..0edf74c 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -18,6 +18,16 @@ test_expect_success 'setup - initial commit' '
git branch initial
'
+test_expect_success 'configuration parsing' '
+ test_when_finished "rm -f .gitmodules" &&
+ cat >.gitmodules <<-\EOF &&
+ [submodule "s"]
+ path
+ ignore
+ EOF
+ test_must_fail git status
+'
+
test_expect_success 'setup - repository in init subdirectory' '
mkdir init &&
(