git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
Jun 15, 2007, 01:01 UTC
Message-ID
<11818693133210-git-send-email-frank@lichtenheld.de>
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>
---
 git-cvsserver.perl              |   10 ++++++----
 t/t9400-git-cvsserver-server.sh |    1 +
 2 files changed, 7 insertions(+), 4 deletions(-)
 I can also squash these two fix-ups into the previous commit
 if preferred.
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 9fbd9db..f78afe8 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 392f890..9b69452 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)' \
-- 
1.5.2.1
Next: Frank Lichtenheld
Message 1 of 4 in “cvsserver: Let --base-path and pserver get along just fine”
  1. cvsserver: Let --base-path and pserver get along just fineFrank Lichtenheld, Jun 15, 2007
  2. cvsserver: Actually implement --export-allFrank Lichtenheld, Jun 15, 2007
  3. Alex RiesenJun 16, 2007
  4. Junio C HamanoJun 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.