# HG changeset patch # User Marcin Kuzminski # Date 2018-08-11 12:21:46 # Node ID caa31d8ff89405a9944663477cd189c4282d2f6f # Parent d7b4a8415c6038a54da4f121f404d195e4cbd8ab git: allow head command to not raise exception is we wish to have only return value. diff --git a/vcsserver/git.py b/vcsserver/git.py --- a/vcsserver/git.py +++ b/vcsserver/git.py @@ -526,9 +526,13 @@ class GitRemote(object): return repo.refs.path @reraise_safe_exceptions - def head(self, wire): + def head(self, wire, show_exc=True): repo = self._factory.repo(wire) - return repo.head() + try: + return repo.head() + except Exception: + if show_exc: + raise @reraise_safe_exceptions def init(self, wire):