@matheusbsbs / matheus-bagliano / commits / 9aec7e0ba6
Fork 0

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>

Johan Herland committed Aug 19, 2009 at 03:45 UTC 9aec7e0ba69334cf9bfc6bca6abbea7e84d676b2
1 file changed +3 -3
t/t7407-submodule-foreach.sh
+3 -3
@@ -61,9 +61,9 @@ sub3sha1=$(cd super/sub3 && git rev-parse HEAD)
61
62 cat > expect <<EOF
63 Entering 'sub1'
64 -sub1-$sub1sha1
64 +foo1-sub1-$sub1sha1
65 Entering 'sub3'
66 -sub3-$sub3sha1
66 +foo3-sub3-$sub3sha1
67 EOF
68
69 test_expect_success 'test basic "submodule foreach" usage' '
@@ -71,7 +71,7 @@ test_expect_success 'test basic "submodule foreach" usage' '
71 (
72 cd clone &&
73 git submodule update --init -- sub1 sub3 &&
74 - git submodule foreach "echo \$path-\$sha1" > ../actual
74 + git submodule foreach "echo \$name-\$path-\$sha1" > ../actual
75 ) &&
76 test_cmp expect actual
77 '