diff mbox series

[12/15] t1409: let sed open its own files

Message ID 0b7d19a7e1498238f3d6d4d9bb07b3345cbb345f.1576583819.git.liu.denton@gmail.com (mailing list archive)
State New, archived
Headers show
Series t: replace incorrect test_must_fail usage (part 1) | expand

Commit Message

Denton Liu Dec. 17, 2019, 12:01 p.m. UTC
In one case, we were using a redirection operator to feed input into
sed. However, since sed is capable of opening its own files, make sed
open its own files instead of redirecting input into it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/t1409-avoid-packing-refs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Dec. 17, 2019, 6:57 p.m. UTC | #1
Denton Liu <liu.denton@gmail.com> writes:

> Subject: Re: [PATCH 12/15] t1409: let sed open its own files

s/files/input file/;

This is borderline Meh to me, but since the patch has already been
written, let's use it ;-)

> In one case, we were using a redirection operator to feed input into
> sed. However, since sed is capable of opening its own files, make sed
> open its own files instead of redirecting input into it.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  t/t1409-avoid-packing-refs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh
> index c46848eb8e..f74d890e82 100755
> --- a/t/t1409-avoid-packing-refs.sh
> +++ b/t/t1409-avoid-packing-refs.sh
> @@ -8,7 +8,7 @@ test_description='avoid rewriting packed-refs unnecessarily'
>  # shouldn't upset readers, and it should be omitted if the file is
>  # ever rewritten.
>  mark_packed_refs () {
> -	sed -e "s/^\(#.*\)/\1 t1409 /" <.git/packed-refs >.git/packed-refs.new &&
> +	sed -e "s/^\(#.*\)/\1 t1409 /" .git/packed-refs >.git/packed-refs.new &&
>  	mv .git/packed-refs.new .git/packed-refs
>  }
diff mbox series

Patch

diff --git a/t/t1409-avoid-packing-refs.sh b/t/t1409-avoid-packing-refs.sh
index c46848eb8e..f74d890e82 100755
--- a/t/t1409-avoid-packing-refs.sh
+++ b/t/t1409-avoid-packing-refs.sh
@@ -8,7 +8,7 @@  test_description='avoid rewriting packed-refs unnecessarily'
 # shouldn't upset readers, and it should be omitted if the file is
 # ever rewritten.
 mark_packed_refs () {
-	sed -e "s/^\(#.*\)/\1 t1409 /" <.git/packed-refs >.git/packed-refs.new &&
+	sed -e "s/^\(#.*\)/\1 t1409 /" .git/packed-refs >.git/packed-refs.new &&
 	mv .git/packed-refs.new .git/packed-refs
 }