From 1efb086fe9005032b2124c98f47f39d1a0e9a26a Mon Sep 17 00:00:00 2001 From: somegithubuser Date: Sat, 7 Mar 2015 10:57:59 -0500 Subject: [PATCH] Allow for 1.8.5+ status message format --- gitprompt.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitprompt.pl b/gitprompt.pl index 33d90a2..2acd119 100755 --- a/gitprompt.pl +++ b/gitprompt.pl @@ -204,9 +204,9 @@ sub gitdata { # if it terminated, parse output my ($section); foreach (@status) { - if (/^\# (\S.+?)\:\s*$/ && exists $sectionmap{$1}) { + if (/^(?:\# )?(\S.+?)\:\s*$/ && exists $sectionmap{$1}) { $section = $sectionmap{$1}; - } elsif ($section && /^\#\t\S/) { + } elsif ($section && /^\#?\t\S/) { $statuscount{$section}++; $valid = 1; } elsif (/^nothing to commit\b/) {