diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-06-04 14:22:56 +0300 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-06-04 14:22:56 +0300 |
commit | 0dc22b3155d359fc54d141e3355382ff044ba8e1 (patch) | |
tree | ae6290bf59c6781b53e941baa3e52b445115f088 /gitosis/access.py | |
parent | Add config option ``repositories``, for giving a path prefix to repositories. (diff) | |
download | gitosis-dakkar-0dc22b3155d359fc54d141e3355382ff044ba8e1.tar.gz gitosis-dakkar-0dc22b3155d359fc54d141e3355382ff044ba8e1.tar.bz2 gitosis-dakkar-0dc22b3155d359fc54d141e3355382ff044ba8e1.zip |
Allow ``gitosis-serve`` incoming path names to always have ``.git`` suffix.
Strip it before processing further.
Diffstat (limited to 'gitosis/access.py')
-rw-r--r-- | gitosis/access.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gitosis/access.py b/gitosis/access.py index 77be0c8..1e64072 100644 --- a/gitosis/access.py +++ b/gitosis/access.py @@ -23,6 +23,16 @@ def haveAccess(config, user, mode, path): path=path, )) + basename, ext = os.path.splitext(path) + if ext == '.git': + log.debug( + 'Stripping .git suffix from %(path)r, new value %(basename)r' + % dict( + path=path, + basename=basename, + )) + path = basename + for groupname in group.getMembership(config=config, user=user): try: repos = config.get('group %s' % groupname, mode) |