repocache: suppress some confusing git output
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 19 Aug 2014 15:15:47 +0000 (18:15 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 19 Aug 2014 15:15:47 +0000 (18:15 +0300)
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 <markus.lehtonen@linux.intel.com>
gbp_repocache/__init__.py

index 095b879..3e0879c 100644 (file)
@@ -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: