Re: [PATCH v3 5/5] blame: add tests for ignoring revisions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 13, 2019, 23:31 UTC
- Message-ID
- <xmqqef8b9sfc.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190212222722.240676-6-brho@google.com>
Barret Rhoden <brho@google.com> writes:
> + git rev-parse Y > expect &&
Not limited to this one, but lose the SP between the redirection operator and its target pathname, i.e. "git rev-parse Y >expect".
> + sed -i -e "s/[0-9a-f]/0/g" expect &&
Don't use "sed -i" in-place rewrite, that is not portable.
In the meantime, I'd patch it up with this so that we can keep 'pu' working. Placing "git rev-parse" upstream of a pipe is not kosher, but in the meantime...
t/t8013-blame-ignore-revs.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh index 3a4ad7cf93..e3396a78d0 100755 --- a/t/t8013-blame-ignore-revs.sh +++ b/t/t8013-blame-ignore-revs.sh @@ -57,8 +57,7 @@ test_expect_success ignore_rev_adding_lines ' git commit -m Y && git tag Y && - git rev-parse Y > expect && - sed -i -e "s/[0-9a-f]/0/g" expect && + git rev-parse Y | sed -e "s/[0-9a-f]/0/g" >expect && git blame --line-porcelain file --ignore-rev Y > blame_raw && grep "^[0-9a-f]\+ 3 3" blame_raw | sed -e "s/ .*//" > actual &&