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 successfully.

* The variable $submodulesha1 was not expanded as it was inside a single
  quoted string. Use double quote to expand the variable.

* 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: Junio C Hamano <[email protected]>
Signed-off-by: Stefan Beller <[email protected]>
---

This is just one patch (for bisectability)
it applies on e7b37caf4fe.

Thanks,
Stefan

 t/t7406-submodule-update.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 8c086a4..c327eb6 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -425,11 +425,11 @@ test_expect_success 'submodule update - command in 
.git/config catches failure -
 '
 
 test_expect_success 'submodule update - command run for initial population of 
submodule' '
-       cat <<-\ EOF >expect
-       Execution of '\''false $submodulesha1'\'' failed in submodule path 
'\''submodule'\''
-       EOF &&
+       cat >expect <<-\EOF &&
+       Execution of '\'"false $submodulesha1"\'' failed in submodule path 
'\''submodule'\''
+       EOF
        rm -rf super/submodule &&
-       test_must_fail git -C super submodule update >../actual &&
+       test_must_fail git -C super submodule update 2>actual &&
        test_cmp expect actual &&
        git -C super submodule update --checkout
 '
-- 
2.10.2.50.g9d09a6e.dirty

Reply via email to