If a remote is configured in a superproject relative submodule urls
should be relative to that remote. Since we have a bug in relative
path calculation for superproject paths that contain a "/." using
../submodule was accepted here. We are going to fix this behavior so
we first need to correct these tests.

Later tests expect the submodules origin to be in a directory underneath
the tests root. Lets remove the origin from super (which points directly
at the tests root directory) to keep these tests expectations.

Signed-off-by: Heiko Voigt <hvo...@hvoigt.net>
---
 t/t7403-submodule-sync.sh    | 2 ++
 t/t7406-submodule-update.sh  | 2 ++
 t/t7407-submodule-foreach.sh | 2 ++
 t/t7506-status-submodule.sh  | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 524d5c1..b310a58 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -18,6 +18,8 @@ test_expect_success setup '
        git clone . super &&
        git clone super submodule &&
        (cd super &&
+        # relative submodule urls relate to this folder not the remotes
+        git remote rm origin &&
         git submodule add ../submodule submodule &&
         test_tick &&
         git commit -m "submodule"
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 1542653..f3628c9 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -32,6 +32,8 @@ test_expect_success 'setup a submodule tree' '
        git clone super merging &&
        git clone super none &&
        (cd super &&
+        # relative submodule urls relate to this folder not the remotes
+        git remote rm origin &&
         git submodule add ../submodule submodule &&
         test_tick &&
         git commit -m "submodule" &&
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 9b69fe2..99956a6 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -21,6 +21,8 @@ test_expect_success 'setup a submodule tree' '
        git clone super submodule &&
        (
                cd super &&
+               # relative submodule urls relate to this folder not the remotes
+               git remote rm origin &&
                git submodule add ../submodule sub1 &&
                git submodule add ../submodule sub2 &&
                git submodule add ../submodule sub3 &&
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index d31b34d..9021b1a 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -203,6 +203,8 @@ test_expect_success 'status with merge conflict in 
.gitmodules' '
        test_create_repo_with_commit sub2 &&
        (
                cd super &&
+               # relative submodule urls relate to this folder not the remotes
+               git remote rm origin &&
                prev=$(git rev-parse HEAD) &&
                git checkout -b add_sub1 &&
                git submodule add ../sub1 &&
-- 
1.8.0.3.gaed4666

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to