auth: make ".git" at the end optional

This commit is contained in:
Sitaram Chamarty 2009-10-29 20:52:06 +05:30 committed by Sitaram Chamarty
parent 071ff4c210
commit 648dce20ec

View file

@ -84,9 +84,8 @@ my $cmd = $ENV{SSH_ORIGINAL_COMMAND};
# git-receive-pack 'reponame.git'
# including the single quotes
my ($verb, $repo) = ($cmd =~ /^\s*(git\s+\S+|\S+)\s+'\/?(.*).git'/);
die "bad command: $cmd. Make sure the repo name is exactly\n" .
"as in your config (no extra stuff before the name), plus a \".git\" at the end\n"
my ($verb, $repo) = ($cmd =~ /^\s*(git\s+\S+|\S+)\s+'\/?(.*?)(?:.git)?'/);
die "bad command: $cmd. Make sure the repo name is exactly as in your config\n"
unless ( $verb and ( $verb =~ $R_COMMANDS or $verb =~ $W_COMMANDS )
and $repo and $repo =~ $REPONAME_PATT );