aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaramc@gmail.com>2017-12-06 07:02:06 +0530
committerSitaram Chamarty <sitaramc@gmail.com>2017-12-06 11:05:26 +0530
commit3e0c51e9902ed4940b52207502ae0bb62919a79b (patch)
treeed57675d7c38e8849e8c2c73ba929a3cb66a6f4a /src/gitolite-shell
parentmake pre-receive repo-specific hooks bail on non-zero exit (diff)
downloadgitolite-gentoo-3e0c51e9902ed4940b52207502ae0bb62919a79b.tar.gz
gitolite-gentoo-3e0c51e9902ed4940b52207502ae0bb62919a79b.tar.bz2
gitolite-gentoo-3e0c51e9902ed4940b52207502ae0bb62919a79b.zip
remove trailing "/" if user supplied one
Basically, Linus complained that git-daemon is happy with the trailing / so why does gitolite choke on it? Fair enough. Actual implementation: we choose to kill the "/" at the point of entry, rather than weaken the sanity() function. ref: https://groups.google.com/forum/#!topic/gitolite/zLMoQ7u28gk
Diffstat (limited to 'src/gitolite-shell')
-rwxr-xr-xsrc/gitolite-shell4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gitolite-shell b/src/gitolite-shell
index d9ec01f..2f49479 100755
--- a/src/gitolite-shell
+++ b/src/gitolite-shell
@@ -109,6 +109,10 @@ sub main {
# set up the repo and the attempted access
my ( $verb, $repo ) = parse_soc(); # returns only for git commands
+
+ # remove trailing slash, if any
+ $repo =~ s(/$)();
+
Gitolite::Conf::Load::sanity($repo, $REPONAME_PATT);
$ENV{GL_REPO} = $repo;
my $aa = ( $verb =~ 'upload' ? 'R' : 'W' );