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 <jan.palus@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Mar 22, 2017 at 15:12 UTC
a4dded0189191db1aa572bdc45419182db8ae652
1 file changed
+3
-3
t/t7406-submodule-update.sh
+3
-3
@@ -425,11 +425,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
425
'
426
427
test_expect_success 'submodule update - command run for initial population of submodule' '
428
- cat <<-\ EOF >expect
428
+ cat >expect <<-EOF &&
429
Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
430
- EOF &&
430
+ EOF
431
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 &&
433
test_cmp expect actual &&
434
git -C super submodule update --checkout
435
'