From ea588a57e4588b4d676304b521c7695b0c2d9121 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 29 Oct 2011 16:08:47 +0200 Subject: GitRepository: handle bare repos and errors in is_clean() --- gbp/git.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gbp/git.py') diff --git a/gbp/git.py b/gbp/git.py index d6dddd0..ce4d133 100644 --- a/gbp/git.py +++ b/gbp/git.py @@ -551,14 +551,19 @@ class GitRepository(object): and Git's status message @rtype: C{tuple} """ + if self.bare: + return (True, '') + clean_msg = 'nothing to commit' - out = self.__git_getoutput('status')[0] + out, ret = self.__git_getoutput('status') + if ret: + raise GbpError("Can't get repository status") ret = False for line in out: if line.startswith('#'): continue if line.startswith(clean_msg): - ret = True + ret = True break return (ret, "".join(out)) -- cgit v1.2.3