$serve_dir = "$ENV{HOME}/$serve_dir" unless $serve_dir =~ m|^/|;
-fail "Bad subdirectory $serve_repo" unless $serve_repo =~ m/$repo_regexp/o;
-fail "bad config - repo-regexp does not capture" unless defined $1;
-my $sani_repo= $1;
-
-my $dir = $serve_dir.(length $sani_repo ? "/$sani_repo" : '');
+if (length $serve_repo) {
+ my $inspect= $serve_repo;
+ $inspect =~ s,^/,,;
+ fail "Bad subdirectory $serve_repo" unless $inspect =~ m/$repo_regexp/o;
+ fail "bad config - repo-regexp does not capture" unless defined $1;
+ $serve_repo= "/$1";
+}
+
+my $dir = $serve_dir.$serve_repo;
my $path = $check_export ? "$dir/git-daemon-export-ok" : $dir;
fail "$! $path" unless -e $path;
# regexp, which must contain a single matching
# group which is the filesystem pathname inside
# the <directory>. The default is (Tcl syntax):
-# repo-regexp {^(\w[-+._0-9A-Za-z]*)$}
+# repo-regexp ^(w[-+._0-9A-Za-z]*/?\.git)$
#
# [no-]require-git-daemon-export-ok
# For per-user service. Default is no-.
fail "no specpath ??" unless length $specpath;
our $uri = "git://$spechost/$specpath";
-our $repo_regexp= '^/*(\\w[-+._0-9A-Za-z]*)$'; # stupid emacs ';
+
+our $repo_regexp= '^(\\w[-+._0-9A-Za-z]*/?\.git)$'; # stupid emacs ';
our $check_export= 0;
our ($serve_user, $serve_dir, $serve_repo);