Code

Merge branch 'ks/no-textconv-symlink'
[git.git] / t / t7407-submodule-foreach.sh
index 2a527750ce4a81bc168b8ad3d8b09174f487b142..905a8baae9a03a4b47512bb3eb3e0f9ec84f5ca4 100755 (executable)
@@ -16,7 +16,7 @@ test_expect_success 'setup a submodule tree' '
        echo file > file &&
        git add file &&
        test_tick &&
-       git commit -m upstream
+       git commit -m upstream &&
        git clone . super &&
        git clone super submodule &&
        (
@@ -30,7 +30,7 @@ test_expect_success 'setup a submodule tree' '
                        submodule.sub2 submodule.foo2 &&
                git config -f .gitmodules --rename-section \
                        submodule.sub3 submodule.foo3 &&
-               git add .gitmodules
+               git add .gitmodules &&
                test_tick &&
                git commit -m "submodules" &&
                git submodule init sub1 &&
@@ -59,11 +59,13 @@ test_expect_success 'setup a submodule tree' '
 sub1sha1=$(cd super/sub1 && git rev-parse HEAD)
 sub3sha1=$(cd super/sub3 && git rev-parse HEAD)
 
+pwd=$(pwd)
+
 cat > expect <<EOF
 Entering 'sub1'
-foo1-sub1-$sub1sha1
+$pwd/clone-foo1-sub1-$sub1sha1
 Entering 'sub3'
-foo3-sub3-$sub3sha1
+$pwd/clone-foo3-sub3-$sub3sha1
 EOF
 
 test_expect_success 'test basic "submodule foreach" usage' '
@@ -71,7 +73,9 @@ test_expect_success 'test basic "submodule foreach" usage' '
        (
                cd clone &&
                git submodule update --init -- sub1 sub3 &&
-               git submodule foreach "echo \$name-\$path-\$sha1" > ../actual
+               git submodule foreach "echo \$toplevel-\$name-\$path-\$sha1" > ../actual &&
+               git config foo.bar zar &&
+               git submodule foreach "git config --file \"\$toplevel/.git/config\" foo.bar"
        ) &&
        test_cmp expect actual
 '