Re: [PATCH 1/2] t0001: remove pipes
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Feb 22, 2022, 13:54 UTC
- Message-ID
- <9d08d2a6-82ed-7d6c-6a82-0e89c55bd94a@github.com>
- In-Reply-To
- <20220222114313.14921-2-shivam828787@gmail.com>
On 2/22/2022 6:43 AM, Shubham Mishra wrote:
> pipes doesn't care about error codes and ignore them thus we should not use them in tests. > As an easy alternative, I am using a tmp file to write from git command so we can test the exit code.
Please be careful about the length of your lines in your commit message. vim should auto-wrap as you write.
There are also some grammar issues, so here is an update to what you wrote:
Pipes ignore error codes and thus we should not use them in tests. As an alternative, use a 'tmp' file to write the Git output so we can test the exit code.
(My wrapping is probably too short here.)
Show 15 quoted lines
> Signed-off-by: Shubham Mishra <shivam828787@gmail.com> > --- > t/t0001-init.sh | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/t/t0001-init.sh b/t/t0001-init.sh > index 3235ab4d53..9a8f209648 100755 > --- a/t/t0001-init.sh > +++ b/t/t0001-init.sh > @@ -489,11 +489,11 @@ test_expect_success 're-init from a linked worktree' ' > git worktree add ../linked-worktree && > mv .git/info/exclude expected-exclude && > cp .git/config expected-config && > - find .git/worktrees -print | sort >expected && > + find .git/worktrees -print >tmp && sort tmp >expected &&
Split each part of the &&-chain across lines, like this:
+ find .git/worktrees -print >tmp && + sort tmp >expected &&
Show 5 quoted lines
> git -C ../linked-worktree init && > test_cmp expected-exclude .git/info/exclude && > test_cmp expected-config .git/config && > - find .git/worktrees -print | sort >actual && > + find .git/worktrees -print >tmp && sort tmp >actual &&
Here, too.
I could make the same comments on patch 2, but I think you have enough info to go on.
Thanks, -Stolee