diff options
author | Guido Günther <agx@sigxcpu.org> | 2013-04-27 22:26:36 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-04-27 22:35:48 +0200 |
commit | 059af98c610a8c4924e42d1b62429a89f3dc5dcb (patch) | |
tree | 6063c5a33bfd172516906c3dffdfc1ddb602e1cb /gbp/git | |
parent | 71e9e244caabfca463e7898ff684a9861bb5a582 (diff) |
GitRepository.has_feature: capture stderr
to avoid spurious output on the console and add the error message to the
exception intead.
Diffstat (limited to 'gbp/git')
-rw-r--r-- | gbp/git/repository.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 78d8701..8f87854 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -188,9 +188,12 @@ class GitRepository(object): @rtype: C{bool} """ args = GitArgs(command, '-m') - help, foo, ret = self._git_inout('help', args.args) + help, stderr, ret = self._git_inout('help', + args.args, + capture_stderr=True) if ret: - raise GitRepositoryError("Invalid git command: %s" % command) + raise GitRepositoryError("Invalid git command '%s': %s" + % (command, stderr[:-1])) # Parse git command man page section_re = re.compile(r'^(?P<section>[A-Z].*)') |