From c397000b3b0c1cf3bceb95dfc5fcdaf1844aa751 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 21 Feb 2014 22:48:38 -0800 Subject: [PATCH] grab last item in list which is the branch instead of relying on position. --- plugins/git-prompt/gitstatus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 6d64e827..ef894bff 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -67,7 +67,7 @@ if bline.find('Not currently on any branch') != -1: '--short', 'HEAD'], stdout=PIPE).communicate()[0][:-1] else: - branch = bline.split(' ')[3] + branch = bline.split(' ')[-1] bstatusline = lines[1] match = behead_re.match(bstatusline) if match: