- $im->add($reply);
- $im->done;
- my $rev = `git --git-dir=$maindir rev-list HEAD`;
- like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
- }
-
-}
-
-# obvious failures, first
-{
- local $ENV{HOME} = $home;
- my $res = cgi_run("/", "", "PUT");
- like($res->{head}, qr/Status:\s*405/i, "PUT not allowed");
-
- $res = cgi_run("/");
- like($res->{head}, qr/Status:\s*404/i, "index returns 404");
-}
-
-# dumb HTTP support
-{
- local $ENV{HOME} = $home;
- my $path = "/test/info/refs";
- my $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*200/i, "info/refs readable");
- my $orig = $res->{body};
-
- local $ENV{HTTP_RANGE} = 'bytes=5-10';
- $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*206/i, "info/refs partial OK");
- is($res->{body}, substr($orig, 5, 6), 'partial body OK');
-
- local $ENV{HTTP_RANGE} = 'bytes=5-';
- $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*206/i, "info/refs partial past end OK");
- is($res->{body}, substr($orig, 5), 'partial body OK past end');
-}