Skip to content

Commit 9aec7e0

Browse files
jherlandgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d69ecf6 commit 9aec7e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t7407-submodule-foreach.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ sub3sha1=$(cd super/sub3 && git rev-parse HEAD)
6161

6262
cat > expect <<EOF
6363
Entering 'sub1'
64-
sub1-$sub1sha1
64+
foo1-sub1-$sub1sha1
6565
Entering 'sub3'
66-
sub3-$sub3sha1
66+
foo3-sub3-$sub3sha1
6767
EOF
6868

6969
test_expect_success 'test basic "submodule foreach" usage' '
7070
git clone super clone &&
7171
(
7272
cd clone &&
7373
git submodule update --init -- sub1 sub3 &&
74-
git submodule foreach "echo \$path-\$sha1" > ../actual
74+
git submodule foreach "echo \$name-\$path-\$sha1" > ../actual
7575
) &&
7676
test_cmp expect actual
7777
'

0 commit comments

Comments
 (0)