send-email: more meaningful Message-ID
[gitweb.git] / t / t7400-submodule-basic.sh
index 10f89bd0ce3656a1dee841d19582e5d1bfc9736a..540771ca419b82e4dd32adf986545515fa1db66e 100755 (executable)
@@ -171,6 +171,23 @@ test_expect_success 'submodule add with ./ in path' '
        test_cmp empty untracked
 '
 
+test_expect_success 'submodule add with /././ in path' '
+       echo "refs/heads/master" >expect &&
+       >empty &&
+
+       (
+               cd addtest &&
+               git submodule add "$submodurl" dotslashdotsubmod/././frotz/./ &&
+               git submodule init
+       ) &&
+
+       rm -f heads head untracked &&
+       inspect addtest/dotslashdotsubmod/frotz ../../.. &&
+       test_cmp expect heads &&
+       test_cmp expect head &&
+       test_cmp empty untracked
+'
+
 test_expect_success 'submodule add with // in path' '
        echo "refs/heads/master" >expect &&
        >empty &&
@@ -249,8 +266,7 @@ test_expect_success 'submodule add in subdirectory with relative path should fai
 '
 
 test_expect_success 'setup - add an example entry to .gitmodules' '
-       GIT_CONFIG=.gitmodules \
-       git config submodule.example.url git://example.com/init.git
+       git config --file=.gitmodules submodule.example.url git://example.com/init.git
 '
 
 test_expect_success 'status should fail for unmapped paths' '
@@ -264,7 +280,7 @@ test_expect_success 'setup - map path in .gitmodules' '
        path = init
 EOF
 
-       GIT_CONFIG=.gitmodules git config submodule.example.path init &&
+       git config --file=.gitmodules submodule.example.path init &&
 
        test_cmp expect .gitmodules
 '
@@ -481,7 +497,7 @@ test_expect_success 'do not add files from a submodule' '
 
 '
 
-test_expect_success 'gracefully add submodule with a trailing slash' '
+test_expect_success 'gracefully add/reset submodule with a trailing slash' '
 
        git reset --hard &&
        git commit -m "commit subproject" init &&
@@ -495,7 +511,9 @@ test_expect_success 'gracefully add submodule with a trailing slash' '
        git add init/ &&
        test_must_fail git diff --exit-code --cached init &&
        test $commit = $(git ls-files --stage |
-               sed -n "s/^160000 \([^ ]*\).*/\1/p")
+               sed -n "s/^160000 \([^ ]*\).*/\1/p") &&
+       git reset init/ &&
+       git diff --exit-code --cached init
 
 '
 
@@ -748,7 +766,7 @@ test_expect_success 'moving the superproject does not break submodules' '
        (
                cd addtest &&
                git submodule status >expect
-       )
+       ) &&
        mv addtest addtest2 &&
        (
                cd addtest2 &&
@@ -969,7 +987,7 @@ test_expect_success 'submodule with UTF-8 name' '
 
 test_expect_success 'submodule add clone shallow submodule' '
        mkdir super &&
-       pwd=$(pwd)
+       pwd=$(pwd) &&
        (
                cd super &&
                git init &&