mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 12:03:47 -05:00
Resolve symlinks in configured work tree
Closes https://github.com/tpope/vim-fugitive/issues/1382
This commit is contained in:
@@ -157,16 +157,16 @@ function! s:Tree(path) abort
|
|||||||
let config = readfile(config_file,'',10)
|
let config = readfile(config_file,'',10)
|
||||||
call filter(config,'v:val =~# "^\\s*worktree *="')
|
call filter(config,'v:val =~# "^\\s*worktree *="')
|
||||||
if len(config) == 1
|
if len(config) == 1
|
||||||
let worktree = s:Slash(FugitiveVimPath(matchstr(config[0], '= *\zs.*')))
|
let worktree = FugitiveVimPath(matchstr(config[0], '= *\zs.*'))
|
||||||
endif
|
endif
|
||||||
elseif filereadable(dir . '/gitdir')
|
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 ==# '.'
|
if worktree ==# '.'
|
||||||
unlet! worktree
|
unlet! worktree
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if exists('worktree')
|
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
|
let s:dir_for_worktree[s:worktree_for_dir[dir]] = dir
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user