summaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorMartin Langhoff <martin@catalyst.net.nz>2006-03-04 04:47:22 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-04 06:28:04 (GMT)
commitcdb6760e6f4ba956604d715df191b6f442238d5d (patch)
tree3d50afeefa0a4bf6fbbd1ba30a50ad0dd3a144e8 /git-cvsserver.perl
parent6be32d4791126da12e0eade17362ae8ad3f13971 (diff)
downloadgit-cdb6760e6f4ba956604d715df191b6f442238d5d.zip
git-cdb6760e6f4ba956604d715df191b6f442238d5d.tar.gz
git-cdb6760e6f4ba956604d715df191b6f442238d5d.tar.bz2
cvsserver: better error messages
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>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl15
1 files changed, 14 insertions, 1 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 9da2723..b450792 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -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;