Re: [PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 5, 2024, 22:28 UTC
- Message-ID
- <xmqqplw8xqio.fsf@gitster.g>
- In-Reply-To
- <20240305212533.12947-5-dev+git@drbeat.li>
"Beat Bolli" <bb@drbeat.li> writes:
Show 15 quoted lines
> Signed-off-by: Beat Bolli <dev+git@drbeat.li> > --- > t/annotate-tests.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh > index 5e21e84f3884..87572459e4b8 100644 > --- a/t/annotate-tests.sh > +++ b/t/annotate-tests.sh > @@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' ' > "$(cat file.template)" && > test_commit --author "B <B@test.git>" \ > "change" "$fortran_file" \ > - "$(cat file.template | sed -e s/ChangeMe/IWasChanged/)" && > + "$(sed -e s/ChangeMe/IWasChanged/ file.template)" &&
Obviously correct, but
"$(sed -e s/ChangeMe/IWasChanged/ <file.template)" &&
might be a more faithful conversion (when "sed" looks at its ARGV[], it did not find anything before, and it would not find anything after this patch).
Not worth a reroll, of course, though.