diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2015-08-18 03:22:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-19 21:43:10 +0300 |
commit | 027771fcb153e0003bcb2d68e1838594a48b0161 (patch) | |
tree | 688a3f852ef82161a77db7ec8fd7c59ce601b956 /t/t7411-submodule-config.sh | |
parent | 851e18c3859ad0f9f7e91fdb4d6cce5a8272420b (diff) |
submodule: allow erroneous values for the fetchRecurseSubmodules option
We should not die when reading the submodule config cache since the
user might not be able to get out of that situation when the
configuration is part of the history.
We should handle this condition later when the value is about to be
used.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7411-submodule-config.sh')
-rwxr-xr-x | t/t7411-submodule-config.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh index 7229978cd2..fc97c3314e 100755 --- a/t/t7411-submodule-config.sh +++ b/t/t7411-submodule-config.sh @@ -115,4 +115,39 @@ test_expect_success 'reading of local configuration' ' ) ' +cat >super/expect_fetchrecurse_die.err <<EOF +fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla +EOF + +test_expect_success 'local error in fetchrecursesubmodule dies early' ' + (cd super && + git config submodule.submodule.fetchrecursesubmodules blabla && + test_must_fail test-submodule-config \ + "" b \ + "" submodule \ + >actual.out 2>actual.err && + touch expect_fetchrecurse_die.out && + test_cmp expect_fetchrecurse_die.out actual.out && + test_cmp expect_fetchrecurse_die.err actual.err && + git config --unset submodule.submodule.fetchrecursesubmodules + ) +' + +test_expect_success 'error in history in fetchrecursesubmodule lets continue' ' + (cd super && + git config -f .gitmodules \ + submodule.submodule.fetchrecursesubmodules blabla && + git add .gitmodules && + git config --unset -f .gitmodules \ + submodule.submodule.fetchrecursesubmodules && + git commit -m "add error in fetchrecursesubmodules" && + test-submodule-config \ + HEAD b \ + HEAD submodule \ + >actual && + test_cmp expect_error actual && + git reset --hard HEAD^ + ) +' + test_done |