Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-11-27 22:53:18 +0300
committerJunio C Hamano <gitster@pobox.com>2019-11-30 00:20:14 +0300
commit3b737381d880bd6db1b09d8721f806774931853a (patch)
treecdd494dd455b0fed305207c686997fac99c8cfbd /t/t3600-rm.sh
parent0d913dfa7e41f31befb080512d2e8524338f1907 (diff)
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>
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-xt/t3600-rm.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index f6e659b7e9..0c3bf10edd 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -304,7 +304,8 @@ EOF
test_expect_success 'rm removes empty submodules from work tree' '
mkdir submod &&
- git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod &&
+ hash=$(git rev-parse HEAD) &&
+ git update-index --add --cacheinfo 160000 "$hash" submod &&
git config -f .gitmodules submodule.sub.url ./. &&
git config -f .gitmodules submodule.sub.path submod &&
git submodule init &&
@@ -623,7 +624,8 @@ test_expect_success 'setup subsubmodule' '
git submodule update &&
(
cd submod &&
- git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod &&
+ hash=$(git rev-parse HEAD) &&
+ git update-index --add --cacheinfo 160000 "$hash" subsubmod &&
git config -f .gitmodules submodule.sub.url ../. &&
git config -f .gitmodules submodule.sub.path subsubmod &&
git submodule init &&