Code

cvsserver: Let --base-path and pserver get along just fine
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 15 Jun 2007 01:01:52 +0000 (03:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 Jun 2007 05:38:45 +0000 (22:38 -0700)
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>
git-cvsserver.perl
t/t9400-git-cvsserver-server.sh

index 9fbd9dbb209f582763e6ee5504df847f0e2f7369..f78afe812e2082c687f3436401401be6022196bb 100755 (executable)
@@ -212,15 +212,17 @@ sub req_Root
        return 0;
     }
 
+    my $cvsroot = $state->{'base-path'} || '';
+    $cvsroot =~ s#/+$##;
+    $cvsroot .= $data;
+
     if ($state->{CVSROOT}
-       && ($state->{CVSROOT} ne $data)) {
+       && ($state->{CVSROOT} ne $cvsroot)) {
        print "error 1 Conflicting roots specified\n";
        return 0;
     }
 
-    $state->{CVSROOT} = $state->{'base-path'} || '';
-    $state->{CVSROOT} =~ s#/+$##;
-    $state->{CVSROOT} .= $data;
+    $state->{CVSROOT} = $cvsroot;
 
     $ENV{GIT_DIR} = $state->{CVSROOT} . "/";
 
index 392f890ce61c4eff15ce2269e034004d35cf1570..9b69452d6f4836f637c28854ea0660afbedb62b8 100755 (executable)
@@ -163,6 +163,7 @@ BEGIN AUTH REQUEST
 anonymous
 
 END AUTH REQUEST
+Root /gitcvs.git
 EOF
 
 test_expect_success 'req_Root (base-path)' \