X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7400-submodule-basic.sh;h=af690ec6c1f36871dbd0044d22ab78ab95103541;hb=1d49f0d1a1b7b2941e56cf8384a7a4267e98150c;hp=2ec7ac6a510c5b83bc1ee6ce428379beb7a8b5ef;hpb=8561b522d756861a41c0c54dfa2f609c7063887a;p=git.git diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 2ec7ac6a5..af690ec6c 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -47,6 +47,55 @@ test_expect_success 'Prepare submodule testing' ' GIT_CONFIG=.gitmodules git config submodule.example.url git://example.com/init.git ' +test_expect_success 'Prepare submodule add testing' ' + submodurl=$(pwd) + ( + mkdir addtest && + cd addtest && + git init + ) +' + +test_expect_success 'submodule add' ' + ( + cd addtest && + git submodule add "$submodurl" submod && + git submodule init + ) +' + +test_expect_success 'submodule add with ./ in path' ' + ( + cd addtest && + git submodule add "$submodurl" ././dotsubmod/./frotz/./ && + git submodule init + ) +' + +test_expect_success 'submodule add with // in path' ' + ( + cd addtest && + git submodule add "$submodurl" slashslashsubmod///frotz// && + git submodule init + ) +' + +test_expect_success 'submodule add with /.. in path' ' + ( + cd addtest && + git submodule add "$submodurl" dotdotsubmod/../realsubmod/frotz/.. && + git submodule init + ) +' + +test_expect_success 'submodule add with ./, /.. and // in path' ' + ( + cd addtest && + git submodule add "$submodurl" dot/dotslashsubmod/./../..////realsubmod2/a/b/c/d/../../../../frotz//.. && + git submodule init + ) +' + test_expect_success 'status should fail for unmapped paths' ' if git submodule status then @@ -234,4 +283,17 @@ test_expect_success 'gracefully add submodule with a trailing slash' ' ' +test_expect_success 'ls-files gracefully handles trailing slash' ' + + test "init" = "$(git ls-files init/)" + +' + +test_expect_success 'submodule warns' ' + + git submodule no-such-submodule 2> output.err && + grep "^error: .*no-such-submodule" output.err + +' + test_done