@@ -167,35 +167,34 @@ class GitRepository(object):
log.exception(e)
except Exception, e:
resp = exc.HTTPInternalServerError()
return resp(environ, start_response)
class GitDirectory(object):
def __init__(self, repo_root, repo_name, extras):
repo_location = os.path.join(repo_root, repo_name)
if not os.path.isdir(repo_location):
raise OSError(repo_location)
self.content_path = repo_location
self.repo_name = repo_name
self.repo_location = repo_location
self.extras = extras
def __call__(self, environ, start_response):
content_path = self.content_path
try:
app = GitRepository(self.repo_name, content_path, self.extras)
except (AssertionError, OSError):
if os.path.isdir(os.path.join(content_path, '.git')):
app = GitRepository(self.repo_name,
os.path.join(content_path, '.git'),
self.username)
content_path = os.path.join(content_path, '.git')
if os.path.isdir(content_path):
else:
return exc.HTTPNotFound()(environ, start_response)
return app(environ, start_response)
def make_wsgi_app(repo_name, repo_root, extras):
return GitDirectory(repo_root, repo_name, extras)
Status change: