chiark / gitweb /
a7ae489e6d0f17339317df2232902e04b6fe5c3d
[version-charset-test.git] / check
1 #!/bin/bash
2 set -e
3 set -o pipefail
4
5 rm -rf stunt
6 mkdir stunt
7 cd stunt
8
9 #exec 3<&0 </dev/null
10
11 git init
12 #git commit --allow-empty -m 'Test object'
13 #head=`git rev-parse HEAD`
14
15 #exec <&3 3<&-
16
17 perl -we '
18     use strict;
19
20     our $file;
21     our $count;
22
23     sub complete_batch () {
24         if ($file) {
25             print STDERR "check completing batch\n";
26             close $file or die $!;
27             system "git update-ref --stdin <batch"
28                 and die $? < 0 ? $! : $?;
29         }
30         $file = undef;
31         $count = 0;
32     }
33
34     while (<>) {
35 #print STDERR ">$_<\n";
36         $file ||= new IO::File "batch", ">" or die $!;
37         chomp;
38         print $file "delete refs/tags/$_\n" or die $!;
39         $count++ < 100000 or complete_batch;
40     }
41 #print STDERR "FOO\n";
42     STDIN->error and die $!;
43     complete_batch();
44 '