Imported Upstream version 2.15.4
[platform/upstream/git.git] / t / t7416-submodule-dash-url.sh
index 459193c..2966e93 100755 (executable)
@@ -31,4 +31,18 @@ test_expect_success 'clone rejects unprotected dash' '
        test_i18ngrep ignoring err
 '
 
+test_expect_success 'trailing backslash is handled correctly' '
+       git init testmodule &&
+       test_commit -C testmodule c &&
+       git submodule add ./testmodule &&
+       : ensure that the name ends in a double backslash &&
+       sed -e "s|\\(submodule \"testmodule\\)\"|\\1\\\\\\\\\"|" \
+               -e "s|url = .*|url = \" --should-not-be-an-option\"|" \
+               <.gitmodules >.new &&
+       mv .new .gitmodules &&
+       git commit -am "Add testmodule" &&
+       test_must_fail git clone --verbose --recurse-submodules . dolly 2>err &&
+       test_i18ngrep ! "unknown option" err
+'
+
 test_done