cache-tree: reject entries with null sha1
[gitweb.git] / t / t7400-submodule-basic.sh
index fba2659a22a9f73e30b1f473ee83cf6c625f4f6a..c09ce0d4c1dbd8bc49595be4e3928032fbdc3c8c 100755 (executable)
@@ -152,6 +152,20 @@ test_expect_success 'submodule add to .gitignored path with --force' '
        )
 '
 
+test_expect_success 'submodule add to reconfigure existing submodule with --force' '
+       (
+               cd addtest-ignore &&
+               git submodule add --force bogus-url submod &&
+               git submodule add -b initial "$submodurl" submod-branch &&
+               test "bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" &&
+               test "bogus-url" = "$(git config submodule.submod.url)" &&
+               # Restore the url
+               git submodule add --force "$submodurl" submod
+               test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" &&
+               test "$submodurl" = "$(git config submodule.submod.url)"
+       )
+'
+
 test_expect_success 'submodule add --branch' '
        echo "refs/heads/initial" >expect-head &&
        cat <<-\EOF >expect-heads &&
@@ -352,7 +366,7 @@ test_expect_success 'sync should fail with unknown submodule' '
        test_failure_with_unknown_submodule sync
 '
 
-test_expect_failure 'update should fail when path is used by a file' '
+test_expect_success 'update should fail when path is used by a file' '
        echo hello >expect &&
 
        echo "hello" >init &&
@@ -361,7 +375,7 @@ test_expect_failure 'update should fail when path is used by a file' '
        test_cmp expect init
 '
 
-test_expect_failure 'update should fail when path is used by a nonempty directory' '
+test_expect_success 'update should fail when path is used by a nonempty directory' '
        echo hello >expect &&
 
        rm -fr init &&
@@ -942,7 +956,7 @@ test_expect_success 'submodule deinit from subdirectory' '
                cd sub &&
                git submodule deinit ../init >../output
        ) &&
-       grep "\\.\\./init" output &&
+       test_i18ngrep "\\.\\./init" output &&
        test -z "$(git config --get-regexp "submodule\.example\.")" &&
        test -n "$(git config --get-regexp "submodule\.example2\.")" &&
        test -f example2/.git &&