Respect all git versions

git 2 doesn't use `# `
This commit is contained in:
Nico Revin 2014-07-02 16:41:35 +04:00
commit 5c325f84d5

View file

@ -24,14 +24,14 @@ if error:
lines = output.splitlines()
behead_re = re.compile(
r"^# Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
diverge_re = re.compile(r"^# and have (\d+) and (\d+) different")
r"^(?:# |)Your branch is (ahead of|behind) '(.*)' by (\d+) commit")
diverge_re = re.compile(r"^(?:# |)and have (\d+) and (\d+) different")
status = ''
staged = re.compile(r'^# Changes to be committed:$', re.MULTILINE)
changed = re.compile(r'^# Changed but not updated:$', re.MULTILINE)
untracked = re.compile(r'^# Untracked files:$', re.MULTILINE)
unmerged = re.compile(r'^# Unmerged paths:$', re.MULTILINE)
staged = re.compile(r'^(?:# |)Changes to be committed:$', re.MULTILINE)
changed = re.compile(r'^(?:# |)Changed but not updated:$', re.MULTILINE)
untracked = re.compile(r'^(?:# |)Untracked files:$', re.MULTILINE)
unmerged = re.compile(r'^(?:# |)Unmerged paths:$', re.MULTILINE)
def execute(*command):