Skip to content

Commit a4dded0

Browse files
committed
t7406: correct test case for submodule-update initial population
There are three issues with the test: * The syntax of the here-doc was wrong, such that the entire test was sucked into the here-doc, which is why the test succeeded. * The variable $submodulesha1 was not expanded as it was inside a quoted here text. We do not want to quote EOF marker for this. * The redirection from the git command to the output file for comparison was wrong as the -C operator from git doesn't apply to the redirect path. Also we're interested in stderr of that command. Noticed-by: Jan Palus <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7b37ca commit a4dded0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t7406-submodule-update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
425425
'
426426

427427
test_expect_success 'submodule update - command run for initial population of submodule' '
428-
cat <<-\ EOF >expect
428+
cat >expect <<-EOF &&
429429
Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
430-
EOF &&
430+
EOF
431431
rm -rf super/submodule &&
432-
test_must_fail git -C super submodule update >../actual &&
432+
test_must_fail git -C super submodule update 2>actual &&
433433
test_cmp expect actual &&
434434
git -C super submodule update --checkout
435435
'

0 commit comments

Comments
 (0)