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>2020-03-26 11:27:54 +0300
committerJunio C Hamano <gitster@pobox.com>2020-03-27 20:56:40 +0300
commit3d180973c1bc0723ab4d2225e8df3469cfaa0434 (patch)
treed90d861f4dfc926dca7e850979b63b3d09c78ac3 /t/t5612-clone-refspec.sh
parent0813dd28b948787ed61b3052d36043d9a8348edc (diff)
t5612: stop losing return codes of git commands
In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that their failure is reported. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5612-clone-refspec.sh')
-rwxr-xr-xt/t5612-clone-refspec.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index 28373e715a..e3b436d8ae 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -71,9 +71,9 @@ test_expect_success 'by default all branches will be kept updated' '
(
cd dir_all &&
git fetch &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# follow both master and side
git for-each-ref refs/heads >expect &&
@@ -104,9 +104,9 @@ test_expect_success '--single-branch while HEAD pointing at master' '
(
cd dir_master &&
git fetch --force &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# only follow master
git for-each-ref refs/heads/master >expect &&
@@ -126,9 +126,9 @@ test_expect_success '--single-branch while HEAD pointing at master and --no-tags
(
cd dir_master_no_tags &&
git fetch &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# only follow master
git for-each-ref refs/heads/master >expect &&
@@ -156,9 +156,9 @@ test_expect_success '--single-branch while HEAD pointing at side' '
(
cd dir_side &&
git fetch &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# only follow side
git for-each-ref refs/heads/side >expect &&
@@ -169,9 +169,9 @@ test_expect_success '--single-branch with explicit --branch side' '
(
cd dir_side2 &&
git fetch &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# only follow side
git for-each-ref refs/heads/side >expect &&
@@ -223,9 +223,9 @@ test_expect_success '--single-branch with detached' '
(
cd dir_detached &&
git fetch &&
- git for-each-ref refs/remotes/origin |
+ git for-each-ref refs/remotes/origin >refs &&
sed -e "/HEAD$/d" \
- -e "s|/remotes/origin/|/heads/|" >../actual
+ -e "s|/remotes/origin/|/heads/|" refs >../actual
) &&
# nothing
test_must_be_empty actual