Skip to content

Commit 58ca9ad

Browse files
phordpeff
authored andcommitted
t7407: Fix recursive submodule test
A test in t7404-submodule-foreach purports to test that the --cached flag is properly noticed by --recursive calls to the foreach command as it descends into nested submodules. However, the test really does not perform this test since the change it looks for is in a top-level submodule handled by the first invocation of the command. To properly test for the flag being passed to recursive invocations, the change must be buried deeper in the hierarchy. Move the change one level deeper so it properly verifies the recursive machinery of the 'git submodule status' command. Signed-off-by: Phil Hord <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent 7e20105 commit 58ca9ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7407-submodule-foreach.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ test_expect_success 'test "status --recursive"' '
226226
test_cmp expect actual
227227
'
228228

229-
sed -e "/nested1 /s/.*/+$nested1sha1 nested1 (file2~1)/;/sub[1-3]/d" < expect > expect2
229+
sed -e "/nested2 /s/.*/+$nested2sha1 nested1\/nested2 (file2~1)/;/sub[1-3]/d" < expect > expect2
230230
mv -f expect2 expect
231231

232232
test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
233233
(
234234
cd clone3 &&
235235
(
236-
cd nested1 &&
236+
cd nested1/nested2 &&
237237
test_commit file2
238238
) &&
239239
git submodule status --cached --recursive -- nested1 > ../actual

0 commit comments

Comments
 (0)