]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7400-submodule-basic.sh
git submodule add: make the <path> parameter optional
[thirdparty/git.git] / t / t7400-submodule-basic.sh
index af690ec6c1f36871dbd0044d22ab78ab95103541..a0cc99ab9f5b262851a1075193f5529b5582fd0a 100755 (executable)
@@ -64,6 +64,16 @@ test_expect_success 'submodule add' '
        )
 '
 
+test_expect_success 'submodule add --branch' '
+       (
+               cd addtest &&
+               git submodule add -b initial "$submodurl" submod-branch &&
+               git submodule init &&
+               cd submod-branch &&
+               git branch | grep initial
+       )
+'
+
 test_expect_success 'submodule add with ./ in path' '
        (
                cd addtest &&
@@ -296,4 +306,20 @@ test_expect_success 'submodule <invalid-path> warns' '
 
 '
 
+test_expect_success 'add submodules without specifying an explicit path' '
+       mkdir repo &&
+       cd repo &&
+       git init &&
+       echo r >r &&
+       git add r &&
+       git commit -m "repo commit 1" &&
+       cd .. &&
+       git clone --bare repo/ bare.git &&
+       cd addtest &&
+       git submodule add "$submodurl/repo" &&
+       git config -f .gitmodules submodule.repo.path repo &&
+       git submodule add "$submodurl/bare.git" &&
+       git config -f .gitmodules submodule.bare.path bare
+'
+
 test_done