summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-cvsserver.perl10
-rwxr-xr-xt/t9400-git-cvsserver-server.sh1
2 files changed, 7 insertions, 4 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 9fbd9dbb20..f78afe812e 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -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} . "/";
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 392f890ce6..9b69452d6f 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -163,6 +163,7 @@ BEGIN AUTH REQUEST
anonymous
END AUTH REQUEST
+Root /gitcvs.git
EOF
test_expect_success 'req_Root (base-path)' \