t0021: keep filter log files on comparison
[gitweb.git] / t / t7406-submodule-update.sh
index 8c086a429b8253871b652265390ff6ba47c7074d..034914a14fd49fea07e8bff4802994fcd38807a9 100755 (executable)
@@ -140,6 +140,23 @@ test_expect_success 'submodule update --init --recursive from subdirectory' '
        test_i18ncmp expect2 actual2
 '
 
+cat <<EOF >expect2
+Submodule 'foo/sub' ($pwd/withsubs/../rebasing) registered for path 'sub'
+EOF
+
+test_expect_success 'submodule update --init from and of subdirectory' '
+       git init withsubs &&
+       (cd withsubs &&
+        mkdir foo &&
+        git submodule add "$(pwd)/../rebasing" foo/sub &&
+        (cd foo &&
+         git submodule deinit -f sub &&
+         git submodule update --init sub 2>../../actual2
+        )
+       ) &&
+       test_i18ncmp expect2 actual2
+'
+
 apos="'";
 test_expect_success 'submodule update does not fetch already present commits' '
        (cd submodule &&
@@ -425,12 +442,12 @@ test_expect_success 'submodule update - command in .git/config catches failure -
 '
 
 test_expect_success 'submodule update - command run for initial population of submodule' '
-       cat <<-\ EOF >expect
+       cat >expect <<-EOF &&
        Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
-       EOF &&
+       EOF
        rm -rf super/submodule &&
-       test_must_fail git -C super submodule update >../actual &&
-       test_cmp expect actual &&
+       test_must_fail git -C super submodule update 2>actual &&
+       test_i18ncmp expect actual &&
        git -C super submodule update --checkout
 '