aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-03-03 19:20:37 +0100
committerGuido Günther <agx@sigxcpu.org>2009-03-05 09:30:27 +0100
commit94084b01cd5ea6c1c3de243654e9442f7d4991f4 (patch)
treeccaf2ab6dd5f64fed5f12cf6e037d6be980c9436
parenteceac16df7821d27ce5ca010d341bafb66c0c71f (diff)
Skip all comments before looking for clean_msg
Closes: #518008
-rw-r--r--gbp/git_utils.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/gbp/git_utils.py b/gbp/git_utils.py
index 193efeb..1d8ddb5 100644
--- a/gbp/git_utils.py
+++ b/gbp/git_utils.py
@@ -77,16 +77,12 @@ class GitRepository(object):
clean_msg = 'nothing to commit'
out = self.__git_getoutput('status')[0]
ret = False
- if out[0].startswith('#'):
- try:
- if out[1].strip().startswith(clean_msg):
+ for line in out:
+ if line.startswith('#'):
+ continue
+ if line.startswith(clean_msg):
ret = True
- elif out[3].strip().startswith(clean_msg):
- ret = True
- except IndexError:
- pass
- elif out[0].strip().startswith(clean_msg): # git << 1.5
- ret = True
+ break
return (ret, "".join(out))
def is_empty(self):