... | ... |
@@ -36,18 +36,15 @@ |
36 | 36 |
my $s = IO::Select->new($cout, $cerr); |
37 | 37 |
my $buffer_size = $ENV{GITPREP_SMART_HTTP_BUFFER_SIZE}; |
38 | 38 |
my $error; |
39 |
- my $output; |
|
40 | 39 |
my @ready; |
41 | 40 |
my $cb; |
42 | 41 |
$cb = sub { |
43 | 42 |
my $c = shift; |
44 | 43 |
if (@ready = $s->can_read) { |
45 |
- $output = ''; |
|
44 |
+ my $output = ''; |
|
46 | 45 |
for my $handle (@ready) { |
47 | 46 |
|
48 | 47 |
if (sysread($handle, my $buf, $buffer_size)) { |
49 |
- #warn `ps axuww|grep gitprep` if $k % 3000 == 0; |
|
50 |
- |
|
51 | 48 |
if ($handle == $cerr) { |
52 | 49 |
$error .= $buf; |
53 | 50 |
} |
... | ... |
@@ -89,25 +89,6 @@ note 'Smart HTTP'; |
89 | 89 |
$t->content_like(qr/^001e# service=git-upload-pack/); |
90 | 90 |
$t->content_like(qr/multi_ack_detailed/); |
91 | 91 |
|
92 |
- # /git-upload-pack |
|
93 |
- { |
|
94 |
- my $content = <<EOS; |
|
95 |
-006fwant 6410316f2ed260666a8a6b9a223ad3c95d7abaed multi_ack_detailed no-done side-band-64k thin-pack ofs-delta |
|
96 |
-0032want 6410316f2ed260666a8a6b9a223ad3c95d7abaed |
|
97 |
-00000009done |
|
98 |
-EOS |
|
99 |
- $t->post_ok( |
|
100 |
- '/kimoto/t1.git/git-upload-pack', |
|
101 |
- { |
|
102 |
- 'Content-Type' => 'application/x-git-upload-pack-request', |
|
103 |
- 'Content-Length' => 174, |
|
104 |
- 'Content' => $content |
|
105 |
- } |
|
106 |
- ); |
|
107 |
- $t->status_is(200); |
|
108 |
- $t->content_type_is('application/x-git-upload-pack-result'); |
|
109 |
- } |
|
110 |
- |
|
111 | 92 |
# /info/refs recieve-pack request(Basic authentication) |
112 | 93 |
$t->get_ok('/kimoto/t1.git/info/refs?service=git-receive-pack'); |
113 | 94 |
$t->status_is(401); |
... | ... |
@@ -135,6 +116,26 @@ EOS |
135 | 116 |
); |
136 | 117 |
$t->status_is(200); |
137 | 118 |
$t->content_type_is('application/x-git-receive-pack-result'); |
119 |
+ |
|
120 |
+ # /git-upload-pack |
|
121 |
+ { |
|
122 |
+ $main::p = 1; |
|
123 |
+ my $content = <<EOS; |
|
124 |
+006fwant 6410316f2ed260666a8a6b9a223ad3c95d7abaed multi_ack_detailed no-done side-band-64k thin-pack ofs-delta |
|
125 |
+0032want 6410316f2ed260666a8a6b9a223ad3c95d7abaed |
|
126 |
+00000009done |
|
127 |
+EOS |
|
128 |
+ $t->post_ok( |
|
129 |
+ '/kimoto/t1.git/git-upload-pack', |
|
130 |
+ { |
|
131 |
+ 'Content-Type' => 'application/x-git-upload-pack-request', |
|
132 |
+ 'Content-Length' => 174, |
|
133 |
+ 'Content' => $content |
|
134 |
+ } |
|
135 |
+ ); |
|
136 |
+ $t->status_is(200); |
|
137 |
+ $t->content_type_is('application/x-git-upload-pack-result'); |
|
138 |
+ } |
|
138 | 139 |
} |
139 | 140 |
|
140 | 141 |
note 'Private repository and collaborator'; |
... | ... |
@@ -190,7 +191,7 @@ note 'Private repository and collaborator'; |
190 | 191 |
} |
191 | 192 |
); |
192 | 193 |
$t->status_is(401); |
193 |
- |
|
194 |
+ |
|
194 | 195 |
# Add collaborator |
195 | 196 |
$t->post_ok("/kimoto/t1/settings/collaboration?op=add", form => {collaborator => 'kimoto2'}); |
196 | 197 |
$t->content_like(qr/Collaborator kimoto2 is added/); |
... | ... |
@@ -205,3 +206,6 @@ note 'Private repository and collaborator'; |
205 | 206 |
$t->header_is("Content-Type", "application/x-git-receive-pack-advertisement"); |
206 | 207 |
$t->content_like(qr/^001f# service=git-receive-pack/); |
207 | 208 |
} |
209 |
+ |
|
210 |
+# Fix test error(why?) |
|
211 |
+__END__ |