# HG changeset patch # User Mads Kiilerich # Date 1533687791 -7200 # Node ID 03afcfc0d17f367b35568d6bce1cc541fd610592 # Parent 0ebcc88f1280097854d92d068d3deab685ab0ae8 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. diff -r 0ebcc88f1280 -r 03afcfc0d17f kallithea/lib/middleware/simplegit.py --- a/kallithea/lib/middleware/simplegit.py Wed Aug 08 02:23:11 2018 +0200 +++ b/kallithea/lib/middleware/simplegit.py Wed Aug 08 02:23:11 2018 +0200 @@ -63,12 +63,13 @@ 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 @@ } 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): """