From a2e54704265b58abaa7a6edd0b64548974c69334 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 15 Nov 2007 20:56:15 +0200 Subject: 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. --- gitosis/access.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'gitosis/access.py') 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) -- cgit v1.2.3