From 6d2a83232a2adf4f577a1d13746c7dd82970ed8e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 28 Jun 2018 15:43:13 -0400 Subject: [PATCH] Handle bare repos in FugitivePath() --- autoload/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9d759c7..bd37750 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -439,12 +439,12 @@ endfunction function! fugitive#Path(url) abort let [dir, commit, file] = s:DirCommitFile(a:url) if len(dir) - return s:PlatformSlash(FugitiveTreeForGitDir(dir) . file) + let tree = FugitiveTreeForGitDir(dir) + return s:PlatformSlash((len(tree) ? tree : dir) . file) elseif a:url =~# '^[\\/]\|^\a:[\\/]' return s:PlatformSlash(a:url) - else - return '' endif + return '' endfunction let s:buffer_prototype = {}