From 99d2b89c03c23e8b87eb3d61661819e0efd7ef7c Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 19 Aug 2014 18:15:47 +0300 Subject: [PATCH] repocache: suppress some confusing git output Suppress "fatal: ref XXXX is not a symbolic ref" lines printed into stderr by git in get_ref(). Having a git error here is expected as we fall back to rev-parse in this case. Change-Id: Ieba96ee314e470fe7e5613a8a788bf40ab8b7042 Signed-off-by: Markus Lehtonen --- gbp_repocache/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gbp_repocache/__init__.py b/gbp_repocache/__init__.py index 095b879..3e0879c 100644 --- a/gbp_repocache/__init__.py +++ b/gbp_repocache/__init__.py @@ -47,7 +47,8 @@ class MirrorGitRepository(GitRepository): # pylint: disable=R0904 def get_ref(self, ref): """Get a ref - i.e. where it points to""" - stdout, _stderr, ret = self._git_inout('symbolic-ref', [ref]) + stdout, _stderr, ret = self._git_inout('symbolic-ref', [ref], + capture_stderr=True) if ret: return self.rev_parse(ref) else: -- 2.7.4