aboutsummaryrefslogtreecommitdiff
path: root/t/t5302-pack-index.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-03-12 17:34:34 -0400
committerJunio C Hamano <gitster@pobox.com>2008-03-13 00:57:52 -0700
commitb4ce54fc61e7c76e2d7f47c34733f0f0bbb6c4cd (patch)
tree4bb61d23645a1402c253f7b40e3ed9653999914a /t/t5302-pack-index.sh
parentaadbe44f883859536c5320e0ac1d6ed122c45671 (diff)
downloadgit-b4ce54fc61e7c76e2d7f47c34733f0f0bbb6c4cd.tar.gz
git-b4ce54fc61e7c76e2d7f47c34733f0f0bbb6c4cd.tar.xz
remove use of "tail -n 1" and "tail -1"
The "-n" syntax is not supported by System V versions of tail (which prefer "tail -1"). Unfortunately "tail -1" is not actually POSIX. We had some of both forms in our scripts. Since neither form works everywhere, this patch replaces both with the equivalent sed invocation: sed -ne '$p' Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5302-pack-index.sh')
-rwxr-xr-xt/t5302-pack-index.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 67b9a7b84..b88b5bbd0 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -103,7 +103,7 @@ test_expect_success \
test_expect_success \
'[index v1] 2) create a stealth corruption in a delta base reference' \
'# this test assumes a delta smaller than 16 bytes at the end of the pack
- git show-index <1.idx | sort -n | tail -n 1 | (
+ git show-index <1.idx | sort -n | sed -ne \$p | (
read delta_offs delta_sha1 &&
git cat-file blob "$delta_sha1" > blob_1 &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
@@ -141,7 +141,7 @@ test_expect_success \
test_expect_success \
'[index v2] 2) create a stealth corruption in a delta base reference' \
'# this test assumes a delta smaller than 16 bytes at the end of the pack
- git show-index <1.idx | sort -n | tail -n 1 | (
+ git show-index <1.idx | sort -n | sed -ne \$p | (
read delta_offs delta_sha1 delta_crc &&
git cat-file blob "$delta_sha1" > blob_3 &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&