Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugin/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ endfunction
let s:worktree_for_dir = {}
let s:dir_for_worktree = {}
function! s:Tree(path) abort
if a:path =~# '/\.git$'
return len(a:path) ==# 5 ? '/' : a:path[0:-6]
elseif a:path ==# ''
if a:path ==# ''
return ''
endif
let dir = FugitiveActualDir(a:path)
Expand All @@ -366,6 +364,9 @@ function! s:Tree(path) abort
let wt_config = filter(copy(config), 'v:val =~# "^\\s*worktree *="')
if len(wt_config)
let worktree = FugitiveVimPath(matchstr(wt_config[0], '= *\zs.*'))
elseif a:path =~# '/\.git$'
let s:worktree_for_dir[dir] = len(a:path) ==# 5 ? '/' : a:path[0:-6]
return s:worktree_for_dir[dir]
elseif !exists('worktree')
call filter(config,'v:val =~# "^\\s*bare *= *true *$"')
if empty(config)
Expand Down