From 0c47e1e8f11dc14714aa06bfa40598114d7c7457 Mon Sep 17 00:00:00 2001 From: Martin Bornhold Date: Mon, 8 Aug 2016 15:01:10 +0200 Subject: [PATCH] vcs: Add a flag to the environ to skip the error handling for responses from VCSMiddleware --- rhodecode/lib/middleware/simplevcs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rhodecode/lib/middleware/simplevcs.py b/rhodecode/lib/middleware/simplevcs.py index 6f280c72..d70dc444 100644 --- a/rhodecode/lib/middleware/simplevcs.py +++ b/rhodecode/lib/middleware/simplevcs.py @@ -352,6 +352,12 @@ class SimpleVCS(object): log.info( '%s action on %s repo "%s" by "%s" from %s', action, self.SCM, str_repo_name, safe_str(username), ip_addr) + + # Set a flag to skip error handling for VCSMiddleware responses. This + # prevents converting error responses to human readable error pages + # which otherwise confuses the command line clients. + environ['rhodecode.vcs.skip_error_handling'] = True + return self._generate_vcs_response( environ, start_response, repo_path, repo_name, extras, action)