diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 041c8be..aaa3e13 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -119,7 +119,9 @@ function! fugitive#extract_git_dir(path) abort return resolve(dir) elseif type !=# '' && filereadable(dir) let line = get(readfile(dir, '', 1), 0, '') - if line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1]) + if line =~# '^gitdir: \.' && fugitive#is_git_dir(root.'/'.line[8:-1]) + return simplify(root.'/'.line[8:-1]) + elseif line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1]) return line[8:-1] endif elseif fugitive#is_git_dir(root)