From b09c5d2523f9964add241a04862c2f8bbd7d428f Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 22 Oct 2019 05:13:42 -0400 Subject: [PATCH] Resolve symlinks in configured work tree Closes https://github.com/tpope/vim-fugitive/issues/1382 --- plugin/fugitive.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index fa973f4..be3b99b 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -157,16 +157,16 @@ function! s:Tree(path) abort let config = readfile(config_file,'',10) call filter(config,'v:val =~# "^\\s*worktree *="') if len(config) == 1 - let worktree = s:Slash(FugitiveVimPath(matchstr(config[0], '= *\zs.*'))) + let worktree = FugitiveVimPath(matchstr(config[0], '= *\zs.*')) endif elseif filereadable(dir . '/gitdir') - let worktree = s:Slash(fnamemodify(FugitiveVimPath(readfile(dir . '/gitdir')[0]), ':h')) + let worktree = fnamemodify(FugitiveVimPath(readfile(dir . '/gitdir')[0]), ':h') if worktree ==# '.' unlet! worktree endif endif if exists('worktree') - let s:worktree_for_dir[dir] = worktree + let s:worktree_for_dir[dir] = s:Slash(resolve(worktree)) let s:dir_for_worktree[s:worktree_for_dir[dir]] = dir endif endif