@@ -82,16 +82,16 @@ test_expect_success 'test basic "submodule foreach" usage' '
8282
8383cat > expect << EOF
8484Entering '../sub1'
85- $pwd /clone-foo1-sub1-$sub1sha1
85+ $pwd /clone-foo1-sub1-../sub1- $sub1sha1
8686Entering '../sub3'
87- $pwd /clone-foo3-sub3-$sub3sha1
87+ $pwd /clone-foo3-sub3-../sub3- $sub3sha1
8888EOF
8989
9090test_expect_success ' test "submodule foreach" from subdirectory' '
9191 mkdir clone/sub &&
9292 (
9393 cd clone/sub &&
94- git submodule foreach "echo \$toplevel-\$name-\$sm_path-\$sha1" >../../actual
94+ git submodule foreach "echo \$toplevel-\$name-\$sm_path-\$displaypath-\$ sha1" >../../actual
9595 ) &&
9696 test_i18ncmp expect actual
9797'
@@ -206,25 +206,25 @@ submodulesha1=$(cd clone2/nested1/nested2/nested3/submodule && git rev-parse HEA
206206
207207cat > expect << EOF
208208Entering '../nested1'
209- toplevel: $pwd /clone2 name: nested1 path: nested1 hash: $nested1sha1
209+ toplevel: $pwd /clone2 name: nested1 path: nested1 displaypath: ../nested1 hash: $nested1sha1
210210Entering '../nested1/nested2'
211- toplevel: $pwd /clone2/nested1 name: nested2 path: nested2 hash: $nested2sha1
211+ toplevel: $pwd /clone2/nested1 name: nested2 path: nested2 displaypath: ../nested1/nested2 hash: $nested2sha1
212212Entering '../nested1/nested2/nested3'
213- toplevel: $pwd /clone2/nested1/nested2 name: nested3 path: nested3 hash: $nested3sha1
213+ toplevel: $pwd /clone2/nested1/nested2 name: nested3 path: nested3 displaypath: ../nested1/nested2/nested3 hash: $nested3sha1
214214Entering '../nested1/nested2/nested3/submodule'
215- toplevel: $pwd /clone2/nested1/nested2/nested3 name: submodule path: submodule hash: $submodulesha1
215+ toplevel: $pwd /clone2/nested1/nested2/nested3 name: submodule path: submodule displaypath: ../nested1/nested2/nested3/submodule hash: $submodulesha1
216216Entering '../sub1'
217- toplevel: $pwd /clone2 name: foo1 path: sub1 hash: $sub1sha1
217+ toplevel: $pwd /clone2 name: foo1 path: sub1 displaypath: ../sub1 hash: $sub1sha1
218218Entering '../sub2'
219- toplevel: $pwd /clone2 name: foo2 path: sub2 hash: $sub2sha1
219+ toplevel: $pwd /clone2 name: foo2 path: sub2 displaypath: ../sub2 hash: $sub2sha1
220220Entering '../sub3'
221- toplevel: $pwd /clone2 name: foo3 path: sub3 hash: $sub3sha1
221+ toplevel: $pwd /clone2 name: foo3 path: sub3 displaypath: ../sub3 hash: $sub3sha1
222222EOF
223223
224224test_expect_success ' test "submodule foreach --recursive" from subdirectory' '
225225 (
226226 cd clone2/untracked &&
227- git submodule foreach --recursive "echo toplevel: \$toplevel name: \$name path: \$sm_path hash: \$sha1" >../../actual
227+ git submodule foreach --recursive "echo toplevel: \$toplevel name: \$name path: \$sm_path displaypath: \$displaypath hash: \$sha1" >../../actual
228228 ) &&
229229 test_i18ncmp expect actual
230230'
0 commit comments