commit 92870eb6d2f9663f34f20537ef0393b5ffeb2291 (tree)
parent 5ec0793b8808f5d01b8935a1bcb60bf4fddb6807
Author: Tim Pope <code@tpope.net>
Date: Sat, 28 May 2022 21:57:21 -0400
Remove dead code for resolving symlinked buffer name
The `:p` flag resolves symlinks, so the resolve() call is a no-op, and
the subsequent conditional is always false. It also appears to be no
longer necessary, though I'd have to do a bit more digging to figure out
why.
Diffstat:
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -416,18 +416,12 @@ function! FugitiveExtractGitDir(path) abort
return get(matchlist(path, s:dir_commit_file), 1, '')
elseif empty(path)
return ''
- else
- let path = fnamemodify(path, ':p:h')
endif
let pre = substitute(matchstr(path, '^\a\a\+\ze:'), '^.', '\u&', '')
if len(pre) && exists('*' . pre . 'Real')
- let path ={pre}Real(path)
- endif
- let path = s:Slash(path)
- let root = resolve(path)
- if root !=# path
- silent! exe (haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd') '.'
+ let path = {pre}Real(path)
endif
+ let root = s:Slash(fnamemodify(path, ':p:h'))
let previous = ""
let env_git_dir = len($GIT_DIR) ? s:Slash(simplify(fnamemodify(FugitiveVimPath($GIT_DIR), ':p:s?[\/]$??'))) : ''
call s:Tree(env_git_dir)