Skip to content

Commit

Permalink
cvsserver: Let --base-path and pserver get along just fine
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
flichtenheld authored and gitster committed Jun 16, 2007
1 parent 693b632 commit fd1cd91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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} . "/";

Expand Down
1 change: 1 addition & 0 deletions t/t9400-git-cvsserver-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ BEGIN AUTH REQUEST
anonymous
END AUTH REQUEST
Root /gitcvs.git
EOF

test_expect_success 'req_Root (base-path)' \
Expand Down

0 comments on commit fd1cd91

Please sign in to comment.