Code

Merge branch 'maint'
[git.git] / t / t7400-submodule-basic.sh
index 2ef85a869d515b557815476f126386dc19f755c5..cbc0c34ce2487959ef0e8f89f7c2a5d4a68be826 100755 (executable)
@@ -75,7 +75,7 @@ test_expect_success 'init should register submodule url in .git/config' '
        then
                echo "[OOPS] init succeeded but submodule url is wrong"
                false
-       elif ! git config submodule.example.url ./.subrepo
+       elif test_must_fail git config submodule.example.url ./.subrepo
        then
                echo "[OOPS] init succeeded but update of url failed"
                false
@@ -196,4 +196,17 @@ test_expect_success 'apply submodule diff' '
        test -z "$D"
 '
 
+test_expect_success 'update --init' '
+
+       mv init init2 &&
+       git config -f .gitmodules submodule.example.url "$(pwd)/init2" &&
+       git config --remove-section submodule.example
+       git submodule update init > update.out &&
+       grep "not initialized" update.out &&
+       test ! -d init/.git &&
+       git submodule update --init init &&
+       test -d init/.git
+
+'
+
 test_done