Handle bare repos in FugitivePath()

This commit is contained in:
Tim Pope
2018-06-28 15:43:13 -04:00
parent ea38c7d664
commit 6d2a83232a

View File

@@ -439,12 +439,12 @@ endfunction
function! fugitive#Path(url) abort function! fugitive#Path(url) abort
let [dir, commit, file] = s:DirCommitFile(a:url) let [dir, commit, file] = s:DirCommitFile(a:url)
if len(dir) 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:[\\/]' elseif a:url =~# '^[\\/]\|^\a:[\\/]'
return s:PlatformSlash(a:url) return s:PlatformSlash(a:url)
else
return ''
endif endif
return ''
endfunction endfunction
let s:buffer_prototype = {} let s:buffer_prototype = {}