@matheusbsbs / matheus-bagliano / commits / fd1cd91e94
Fork 0

cvsserver: Let --base-path and pserver get along just fine

Embarassing bug number one in my options patch. Since the code for --base-path support rewrote the cvsroot value after comparing it with a possible existing value (i.e. from pserver authentication) the check always failed. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Frank Lichtenheld committed Jun 15, 2007 at 03:01 UTC fd1cd91e9407bccba3380dad6dcb60c4154d94a2
2 files changed +7 -4
git-cvsserver.perl
+6 -4
@@ -212,15 +212,17 @@ sub req_Root
212 return 0;
213 }
214
215 + my $cvsroot = $state->{'base-path'} || '';
216 + $cvsroot =~ s#/+$##;
217 + $cvsroot .= $data;
218 +
219 if ($state->{CVSROOT}
216 - && ($state->{CVSROOT} ne $data)) {
220 + && ($state->{CVSROOT} ne $cvsroot)) {
221 print "error 1 Conflicting roots specified\n";
222 return 0;
223 }
224
221 - $state->{CVSROOT} = $state->{'base-path'} || '';
222 - $state->{CVSROOT} =~ s#/+$##;
223 - $state->{CVSROOT} .= $data;
225 + $state->{CVSROOT} = $cvsroot;
226
227 $ENV{GIT_DIR} = $state->{CVSROOT} . "/";
228
t/t9400-git-cvsserver-server.sh
+1
@@ -163,6 +163,7 @@ BEGIN AUTH REQUEST
163 anonymous
164
165 END AUTH REQUEST
166 +Root /gitcvs.git
167 EOF
168
169 test_expect_success 'req_Root (base-path)' \