git submodule foreach: test access to submodule name as '$name'
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>
This commit is contained in:
parent
d69ecf6f0e
commit
9aec7e0ba6
@ -61,9 +61,9 @@ 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' '
|
||||
@ -71,7 +71,7 @@ test_expect_success 'test basic "submodule foreach" usage' '
|
||||
(
|
||||
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
|
||||
'
|
||||
|
Loading…
Reference in New Issue
Block a user