mirror of
https://github.com/tpope/vim-fugitive.git
synced 2026-05-11 09:08:29 +08:00
Avoid IO from ":p" during detection
This commit is contained in:
+3
-2
@@ -413,9 +413,10 @@ function! FugitiveExtractGitDir(path) abort
|
|||||||
return matchstr(path, '\C^fugitive:\%(//\)\=\zs.\{-\}\ze\%(//\|::\|$\)')
|
return matchstr(path, '\C^fugitive:\%(//\)\=\zs.\{-\}\ze\%(//\|::\|$\)')
|
||||||
elseif empty(path)
|
elseif empty(path)
|
||||||
return ''
|
return ''
|
||||||
else
|
elseif path !~# '^/\|^\a\+:'
|
||||||
let path = fnamemodify(path, ':p:h')
|
let path = s:Slash(getcwd()) . '/' . path
|
||||||
endif
|
endif
|
||||||
|
let path = fnamemodify(path, ':h')
|
||||||
let pre = substitute(matchstr(path, '^\a\a\+\ze:'), '^.', '\u&', '')
|
let pre = substitute(matchstr(path, '^\a\a\+\ze:'), '^.', '\u&', '')
|
||||||
if len(pre) && exists('*' . pre . 'Real')
|
if len(pre) && exists('*' . pre . 'Real')
|
||||||
let path ={pre}Real(path)
|
let path ={pre}Real(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user