From 43075a59e64c7ce2b83885e63d3b85f10b4451b5 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Thu, 15 Oct 2020 16:54:47 +0200 Subject: [PATCH] [IMP] runbot: allow to define errors policy for _git decode --- runbot/models/repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index 33a7c945..ee8ffe49 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -292,7 +292,7 @@ class Repo(models.Model): for repo in self: repo.path = os.path.join(root, 'repo', _sanitize(repo.name)) - def _git(self, cmd): + def _git(self, cmd, errors='strict'): """Execute a git command 'cmd'""" self.ensure_one() config_args = [] @@ -300,7 +300,7 @@ class Repo(models.Model): config_args = ['-c', 'core.sshCommand=ssh -i %s/.ssh/%s' % (str(Path.home()), self.identity_file)] cmd = ['git', '-C', self.path] + config_args + cmd _logger.info("git command: %s", ' '.join(cmd)) - return subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() + return subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode(errors=errors) def _fetch(self, sha): if not self._hash_exists(sha):