diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-11-15 20:56:15 +0200 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-11-15 20:56:15 +0200 |
commit | a2e54704265b58abaa7a6edd0b64548974c69334 (patch) | |
tree | a78c9bc4e54cba195a12805917217ecce1ed3aca /gitosis/access.py | |
parent | Fix copy-paste that made gitosis.gitweb use wrong logger. (diff) | |
download | gitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.tar.gz gitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.tar.bz2 gitosis-dakkar-a2e54704265b58abaa7a6edd0b64548974c69334.zip |
Create leading directories when creating missing repos in gitosis-serve.
Creation is in gitosis.serve and not directly in repository.init(),
because that's the location that can tell what part of the directory
tree is allowed to be missing. Made the reconstructed git command
include the extension as that was easier to do.
haveAccess return value is now tuple, to preserve information on what
parts of the path can be missing.
Diffstat (limited to 'gitosis/access.py')
-rw-r--r-- | gitosis/access.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gitosis/access.py b/gitosis/access.py index 21724e0..c95c842 100644 --- a/gitosis/access.py +++ b/gitosis/access.py @@ -10,8 +10,8 @@ def haveAccess(config, user, mode, path): Note for read-only access, the caller should check for write access too. - Returns ``None`` for no access, or the physical repository path - for access granted to that repository. + Returns ``None`` for no access, or a tuple of toplevel directory + containing repositories and a relative path to the physical repository. """ log = logging.getLogger('gitosis.access.haveAccess') @@ -85,10 +85,4 @@ def haveAccess(config, user, mode, path): prefix=prefix, path=mapping, )) - mapping = os.path.join(prefix, mapping) - log.debug( - 'New path is %(path)r' - % dict( - path=mapping, - )) - return mapping + return (prefix, mapping) |