@matheusbsbs / matheus-bagliano / commits / 3b737381d8
Fork 0

t3600: stop losing return codes of git commands

When a command is in a non-assignment command substitution, the return code will be lost in favour of the surrounding command's. As a result, if a git command fails, we won't know about it. Rewrite instances of this so that git commands are either run in an assignment-only command substitution so that their return codes aren't lost. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Nov 27, 2019 at 11:53 UTC 3b737381d880bd6db1b09d8721f806774931853a
1 file changed +4 -2
t/t3600-rm.sh
+4 -2
@@ -304,7 +304,8 @@ EOF
304
305 test_expect_success 'rm removes empty submodules from work tree' '
306 mkdir submod &&
307 - git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod &&
307 + hash=$(git rev-parse HEAD) &&
308 + git update-index --add --cacheinfo 160000 "$hash" submod &&
309 git config -f .gitmodules submodule.sub.url ./. &&
310 git config -f .gitmodules submodule.sub.path submod &&
311 git submodule init &&
@@ -623,7 +624,8 @@ test_expect_success 'setup subsubmodule' '
624 git submodule update &&
625 (
626 cd submod &&
626 - git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod &&
627 + hash=$(git rev-parse HEAD) &&
628 + git update-index --add --cacheinfo 160000 "$hash" subsubmod &&
629 git config -f .gitmodules submodule.sub.url ../. &&
630 git config -f .gitmodules submodule.sub.path subsubmod &&
631 git submodule init &&