From 72df3df26aa283303b186b879387a026648f5571 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Thu, 25 Sep 2014 23:19:32 +0200 Subject: [PATCH] =?UTF-8?q?fixes=20#3221=20:=20correct=20parsing=20of=20gi?= =?UTF-8?q?t=20status=C2=A0:=20some=20config=20does=20not=20have=20leading?= =?UTF-8?q?=20#=20in=20git=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/git-prompt/gitstatus.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 256841432..2903b04c0 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -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'^(?:# )?Changes not staged for commit:$', re.MULTILINE) +untracked = re.compile(r'^(?:# )?Untracked files:$', re.MULTILINE) +unmerged = re.compile(r'^(?:# )?Unmerged paths:$', re.MULTILINE) def execute(*command):