aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gbp/git.py9
-rw-r--r--tests/test_GitRepository.py2
2 files changed, 9 insertions, 2 deletions
diff --git a/gbp/git.py b/gbp/git.py
index d6dddd0d..ce4d1338 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))
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 34b96604..55bf9cbe 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -343,6 +343,8 @@ def test_create_bare():
True
>>> bare.is_empty()
True
+ >>> bare.is_clean()
+ (True, '')
"""
def test_teardown():