GitRepository/git_command: strip stderr output in case of error
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 11 Dec 2013 13:50:13 +0000 (15:50 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 14 Nov 2014 12:22:07 +0000 (14:22 +0200)
In order to get rid of extra line feeds in exception message.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/git/repository.py

index 6042cad..1702cd5 100644 (file)
@@ -276,7 +276,8 @@ class GitRepository(object):
         except Exception as excobj:
             raise GitRepositoryError("Error running git %s: %s" % (command, excobj))
         if ret:
-            raise GitRepositoryError("Error running git %s: %s" % (command, stderr))
+            raise GitRepositoryError("Error running git %s: %s" %
+                                        (command, stderr.strip()))
 
 
     def _cmd_has_feature(self, command, feature):