diff options
author | Guido Guenther <agx@sigxcpu.org> | 2008-09-26 16:55:03 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2008-09-26 16:55:03 +0200 |
commit | b1a28472fce078dbc5e942a498cc50abf73e8375 (patch) | |
tree | a01ad9edebf2bfd6685badc92d48d93f03d91a2c | |
parent | 632c9b467d574e11daf209ee9441456f687d0a16 (diff) |
adjust is_clean for git 1.6
when tracking a remote branch it prints:
\# On branch debian
\# Your branch is ahead of 'origin/master' by 1 commit.
\#
nothing to commit (working directory clean)
so check the 4th line of output too.
Closes: #500238
-rw-r--r-- | gbp/git_utils.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gbp/git_utils.py b/gbp/git_utils.py index d9307e77..204e2626 100644 --- a/gbp/git_utils.py +++ b/gbp/git_utils.py @@ -71,12 +71,17 @@ class GitRepository(object): self.__check_path() clean_msg = 'nothing to commit' out = self.__git_getoutput('status')[0] - if out[0].startswith('#') and out[1].strip().startswith(clean_msg): - ret = True + ret = False + if out[0].startswith('#'): + try: + if out[1].strip().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 - else: - ret = False return (ret, "".join(out)) def index_files(self): |