aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-13 11:21:49 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-13 11:21:49 -0700
commit08b56871ff7ade47310461cf7f6f4f8e72200c60 (patch)
treea0743607c6ada22ce4e4f79061046e94219632c6 /t
parent534930807c230436a2b3f4891df810af0b8c0353 (diff)
parentf030c96d8643fa0a1a9b2bd9c2f36a77721fb61f (diff)
downloadgit-08b56871ff7ade47310461cf7f6f4f8e72200c60.tar.gz
git-08b56871ff7ade47310461cf7f6f4f8e72200c60.tar.xz
Merge branch 'ab/submodule-foreach-toplevel'
* ab/submodule-foreach-toplevel: git-submodule foreach: Add $toplevel variable
Diffstat (limited to 't')
-rwxr-xr-xt/t7407-submodule-foreach.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 2a527750c..db9365b64 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -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
'