From a792da75c4bfb8bf9daf9af74cf8708ee89fe87f Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 13 Jan 2010 17:39:54 -0500 Subject: [PATCH] Be flexible with path delimiter in detection --- plugin/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 42d8e62..0a0f7fe 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -88,9 +88,9 @@ function! s:ExtractGitDir(path) abort let nfn = fn while fn != ofn if isdirectory(fn . '/.git') - return s:sub(simplify(fnamemodify(fn . '/.git',':p')),'/$','') + return s:sub(simplify(fnamemodify(fn . '/.git',':p')),'\W$','') elseif fn =~ '\.git$' && filereadable(fn . '/HEAD') - return s:sub(simplify(fnamemodify(fn,':p')),'/$','') + return s:sub(simplify(fnamemodify(fn,':p')),'\W$','') endif let ofn = fn let fn = fnamemodify(ofn,':h')