From c01d4d7be1fcc5907a5bb8aadf71e9ec5f3e4b71 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Sat, 4 Jul 2009 17:50:06 +0100 Subject: [PATCH] Allow for branch names with slashs in them. Previously, the assumption was that branch names wouldn't have slashes in them. This is incorrect, since branch names in the form: TA/some-feature Are quite common. This fixes that by not splitting on "/" and simply removing the "refs/head/" prefix from the HEAD file, which then leaves the full branch name in its entirety. Signed-off-by: Thomas Adam --- git-branch-info.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-branch-info.vim b/git-branch-info.vim index 95af374..3b40dcd 100644 --- a/git-branch-info.vim +++ b/git-branch-info.vim @@ -253,7 +253,9 @@ function GitBranchInfoTokens() let s:current = s:rebase_msg return [s:current,[],[]] endif - let s:current = split(split(l:contents)[1],"/")[2] + "TA: 2009/07/04 -- Allow for branches with slashes in their name, a + "la "auth/current-branch", by only removing the refs/head/ prefix. + let s:current = substitute(l:contents, "^.*refs\/heads\/", "", "") if exists("g:git_branch_status_head_current") let l:heads = [] else -- 2.11.4.GIT