mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Revert "Avoid IO from ":p" during detection"
This change failed to account for the directory edge case, where ":p:h"
has the very nice property of giving us back the original input, due to
":p" appending a trailing slash. Without this, we fail to detect when
editing the root of the repository.
This reverts commit 1b811b88a4.
Resolves: https://github.com/tpope/vim-fugitive/issues/1978
Resolves: https://github.com/tpope/vim-fugitive/issues/1979
This commit is contained in:
@@ -413,10 +413,9 @@ function! FugitiveExtractGitDir(path) abort
|
||||
return matchstr(path, '\C^fugitive:\%(//\)\=\zs.\{-\}\ze\%(//\|::\|$\)')
|
||||
elseif empty(path)
|
||||
return ''
|
||||
elseif path !~# '^/\|^\a\+:'
|
||||
let path = s:Slash(getcwd()) . '/' . path
|
||||
else
|
||||
let path = fnamemodify(path, ':p:h')
|
||||
endif
|
||||
let path = fnamemodify(path, ':h')
|
||||
let pre = substitute(matchstr(path, '^\a\a\+\ze:'), '^.', '\u&', '')
|
||||
if len(pre) && exists('*' . pre . 'Real')
|
||||
let path ={pre}Real(path)
|
||||
|
||||
Reference in New Issue
Block a user