aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7413-submodule-is-active.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7413-submodule-is-active.sh')
-rwxr-xr-xt/t7413-submodule-is-active.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/t7413-submodule-is-active.sh b/t/t7413-submodule-is-active.sh
index 7cdc263764..b9c89b1019 100755
--- a/t/t7413-submodule-is-active.sh
+++ b/t/t7413-submodule-is-active.sh
@@ -22,7 +22,7 @@ test_expect_success 'setup' '
git -C super submodule add ../sub sub2 &&
# Remove submodule.<name>.active entries in order to test in an
- # environment where only URLs are present in the conifg
+ # environment where only URLs are present in the config
git -C super config --unset submodule.sub1.active &&
git -C super config --unset submodule.sub2.active &&
@@ -51,6 +51,22 @@ test_expect_success 'is-active works with submodule.<name>.active config' '
test-tool -C super submodule is-active sub1
'
+test_expect_success 'is-active handles submodule.active config missing a value' '
+ cp super/.git/config super/.git/config.orig &&
+ test_when_finished mv super/.git/config.orig super/.git/config &&
+
+ cat >>super/.git/config <<-\EOF &&
+ [submodule]
+ active
+ EOF
+
+ cat >expect <<-\EOF &&
+ error: missing value for '\''submodule.active'\''
+ EOF
+ test-tool -C super submodule is-active sub1 2>actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'is-active works with basic submodule.active config' '
test_when_finished "git -C super config submodule.sub1.URL ../sub" &&
test_when_finished "git -C super config --unset-all submodule.active" &&