Re: [PATCH v2] t2027: avoid using pipes
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Mar 9, 2017, 12:30 UTC
- Message-ID
- <CAP8UFD19njU30HODYvp1pddpZaVSVGgn7whcTa2rdjMPe-vzYQ@mail.gmail.com>
- In-Reply-To
- <0102015ab27c6633-c61f56f2-0504-4af3-badc-34246cf635aa-000000@eu-west-1.amazonses.com>
On Thu, Mar 9, 2017 at 10:53 AM, Prathamesh Chavan <pc44800@gmail.com> wrote:
Show 8 quoted lines
> Whenever a git command is present in the upstream of a pipe, its failure > gets masked by piping and hence it should be avoided for testing the > upstream git command. By writing out the output of the git command to > a file, we can test the exit codes of both the commands as a failure exit > code in any command is able to stop the && chain. > > Signed-off-by: Prathamesh <pc44800@gmail.com> > ---
Please add in Cc those who previously commented on the patch.
Show 13 quoted lines
> t/t2027-worktree-list.sh | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/t/t2027-worktree-list.sh b/t/t2027-worktree-list.sh > index 848da5f..daa7a04 100755 > --- a/t/t2027-worktree-list.sh > +++ b/t/t2027-worktree-list.sh > @@ -31,7 +31,7 @@ test_expect_success '"list" all worktrees from main' ' > test_when_finished "rm -rf here && git worktree prune" && > git worktree add --detach here master && > echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect && > - git worktree list | sed "s/ */ /g" >actual && > + git worktree list >out && sed "s/ */ /g" <out >actual &&
I still think that it would be better if the 'sed' commend was on its own line like this:
+ git worktree list >out && + sed "s/ */ /g" <out >actual &&
> test_cmp expect actual > '