Mercurial > kallithea
diff rhodecode/lib/middleware/simplegit.py @ 2058:fb51a6fc10ae beta
updated CONTRIBUTORS
- code garden
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 28 Feb 2012 05:25:16 +0200 |
parents | 766696ee9487 |
children | 572855f7a392 |
line wrap: on
line diff
--- a/rhodecode/lib/middleware/simplegit.py Mon Feb 27 18:15:39 2012 -0800 +++ b/rhodecode/lib/middleware/simplegit.py Tue Feb 28 05:25:16 2012 +0200 @@ -82,9 +82,11 @@ GIT_PROTO_PAT = re.compile(r'git-upload-pack|git-receive-pack|info\/refs') + def is_git(action): return action in ['pull','push'] + class SimpleGit(BaseVCSController): def _handle_request(self, environ, start_response): @@ -230,16 +232,18 @@ return User.get_by_username(username) def __get_action(self, environ): - """Maps git request commands into a pull or push command. + """ + Maps git request commands into a pull or push command. :param environ: """ service = environ['QUERY_STRING'].split('=') if len(service) > 1: service_cmd = service[1] - mapping = {'git-receive-pack': 'push', - 'git-upload-pack': 'pull', - } + mapping = { + 'git-receive-pack': 'push', + 'git-upload-pack': 'pull', + } return mapping.get(service_cmd, service_cmd if service_cmd else 'other')