diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-08 14:05:55 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-08 14:05:55 -0800 |
commit | 6a7bf0ddb21ad2dd263aa2a5a1a7ab364477c4b9 (patch) | |
tree | 3e47f4a5be6a554631f51e0d3ea0427ef5362204 | |
parent | Merge branch 'ab/branch-sort' into maint (diff) | |
parent | p5303: avoid sed GNU-ism (diff) | |
download | tgif-6a7bf0ddb21ad2dd263aa2a5a1a7ab364477c4b9.tar.xz |
Merge branch 'jk/p5303-sed-portability-fix' into maint
A perf script was made more portable.
* jk/p5303-sed-portability-fix:
p5303: avoid sed GNU-ism
-rwxr-xr-x | t/perf/p5303-many-packs.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/t/perf/p5303-many-packs.sh b/t/perf/p5303-many-packs.sh index f4c2ab0584..ce0c42cc9f 100755 --- a/t/perf/p5303-many-packs.sh +++ b/t/perf/p5303-many-packs.sh @@ -21,10 +21,14 @@ repack_into_n () { mkdir staging && git rev-list --first-parent HEAD | - sed -n '1~5p' | - head -n "$1" | - perl -e 'print reverse <>' \ - >pushes + perl -e ' + my $n = shift; + while (<>) { + last unless @commits < $n; + push @commits, $_ if $. % 5 == 1; + } + print reverse @commits; + ' "$1" >pushes # create base packfile head -n 1 pushes | |