Skip to content

Commit

Permalink
cvsserver: better error messages
Browse files Browse the repository at this point in the history
We now have different error messages when the repo is not found vs repo is
not configured to allow gitcvs. Should help users during initial checkouts.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Martin Langhoff authored and Junio C Hamano committed Mar 4, 2006
1 parent 6be32d4 commit cdb6760
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,21 @@ sub req_Root
$state->{CVSROOT} = $data;

$ENV{GIT_DIR} = $state->{CVSROOT} . "/";
unless (-d $ENV{GIT_DIR} && -e $ENV{GIT_DIR}.'HEAD') {
print "E $ENV{GIT_DIR} does not seem to be a valid GIT repository\n";
print "E \n";
print "error 1 $ENV{GIT_DIR} is not a valid repository\n";
return 0;
}

foreach my $line ( `git-var -l` )
my @gitvars = `git-var -l`;
if ($?) {
print "E problems executing git-var on the server -- this is not a git repository or the PATH is not set correcly.\n";
print "E \n";
print "error 1 - problem executing git-var\n";
return 0;
}
foreach my $line ( @gitvars )
{
next unless ( $line =~ /^(.*?)\.(.*?)=(.*)$/ );
$cfg->{$1}{$2} = $3;
Expand Down

0 comments on commit cdb6760

Please sign in to comment.