Changeset - 03afcfc0d17f
[Not reviewed]
default
0 1 0
Mads Kiilerich - 7 years ago 2018-08-08 02:23:11
mads@kiilerich.com
middleware: clean-up of Git _git_stored_op

This seems to do the same in a simpler way.

It is unclear what _git_first_op did. But no matter if it is a typo or
something else, it is unused.
1 file changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/middleware/simplegit.py
Show inline comments
 
@@ -63,12 +63,13 @@ def is_git(environ):
 

	
 
class SimpleGit(BaseVCSController):
 

	
 
    _git_stored_op = 'pull' # most recent kind of command
 

	
 
    def _handle_request(self, environ, start_response):
 
        if not is_git(environ):
 
            return self.application(environ, start_response)
 

	
 
        ip_addr = self._get_ip_addr(environ)
 
        self._git_first_op = False
 
        # skip passing error to error controller
 
        environ['pylons.status_code_redirect'] = True
 

	
 
@@ -194,12 +195,9 @@ class SimpleGit(BaseVCSController):
 
            }
 
            op = mapping[service_cmd]
 
            self._git_stored_op = op
 
            return op
 
        else:
 
            # try to fallback to stored variable as we don't know if the last
 
            # operation is pull/push
 
            op = getattr(self, '_git_stored_op', 'pull')
 
        return op
 
        return self._git_stored_op
 

	
 
    def _handle_githooks(self, repo_name, action, baseui, environ):
 
        """
0 comments (0 inline, 0 general)