From 1f6e0aef97ae1cd720bb2932c153d41438d4d19e Mon Sep 17 00:00:00 2001 From: Victor Bogado Date: Mon, 1 Jun 2009 17:13:51 -0300 Subject: [PATCH] Fixes bug that prevents git-buffer-info from finding the git-dir. If the function GitBranchInfoFindDir were used is a subdir that is deeper than the "root" dir for the project it would terminate the "for" prematurelly. --- git-branch-info.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-branch-info.vim b/git-branch-info.vim index 28ef05e..b0593f5 100644 --- a/git-branch-info.vim +++ b/git-branch-info.vim @@ -143,14 +143,14 @@ function GitBranchInfoFindDir() let l:buflist = strlen(l:bufname)>0 ? split(l:bufname,"/") : [""] let l:prefix = l:bufname =~ "^/" ? "/" : "" let b:git_dir = "" - for l:item in l:buflist + while len(l:buflist) > 0 let l:path = l:prefix.join(l:buflist,"/").l:prefix.".git" if !empty(finddir(l:path)) let b:git_dir = l:path break endif call remove(l:buflist,-1) - endfor + endwhile return b:git_dir endfunction -- 2.11.4.GIT