Accept alternate forms of Fugitive URL

This is to prepare for a potential transition to a URL replacement that
isn't mutilated by simplify().
This commit is contained in:
Tim Pope
2018-06-15 23:10:05 -04:00
parent bb54881388
commit d39d5ca429
2 changed files with 11 additions and 11 deletions

View File

@@ -59,8 +59,8 @@ endfunction
function! FugitiveExtractGitDir(path) abort
let path = s:shellslash(a:path)
if path =~# '^fugitive://.*//'
return matchstr(path, '\C^fugitive://\zs.\{-\}\ze//')
if path =~# '^fugitive:'
return matchstr(path, '\C^fugitive:\%(//\)\=\zs.\{-\}\ze\%(//\|::\|$\)')
elseif isdirectory(path)
let path = fnamemodify(path, ':p:s?/$??')
else