Skip to content

Commit

Permalink
git submodule foreach: test access to submodule name as '$name'
Browse files Browse the repository at this point in the history
Add verification of the behaviour of '$name' to the git submodule
foreach selftest.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johan Herland authored and Junio C Hamano committed Aug 19, 2009
1 parent d69ecf6 commit 9aec7e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/t7407-submodule-foreach.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ sub3sha1=$(cd super/sub3 && git rev-parse HEAD)

cat > expect <<EOF
Entering 'sub1'
sub1-$sub1sha1
foo1-sub1-$sub1sha1
Entering 'sub3'
sub3-$sub3sha1
foo3-sub3-$sub3sha1
EOF

test_expect_success 'test basic "submodule foreach" usage' '
git clone super clone &&
(
cd clone &&
git submodule update --init -- sub1 sub3 &&
git submodule foreach "echo \$path-\$sha1" > ../actual
git submodule foreach "echo \$name-\$path-\$sha1" > ../actual
) &&
test_cmp expect actual
'
Expand Down

0 comments on commit 9aec7e0

Please sign in to comment.