From a8d450fcfe198d1a09676da0f98b47096db6d3fd Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 15 May 2012 21:50:13 -0400 Subject: [PATCH] Support submodules on 1.7.10 In 1.7.10, the git-file switched from using an absolute to a relative path. Treat any path starting with "." as relative. (A more robust check for a relative path is more complicated than looking for a leading slash because of Windows.) Closes #201. --- plugin/fugitive.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)