Support symlinked .git if core.worktree is set

Closes #155.
This commit is contained in:
Tim Pope
2012-03-18 20:57:36 -04:00
parent 0b1625a798
commit 3c12ec8053

View File

@@ -123,7 +123,8 @@ function! s:extract_git_dir(path) abort
while fn !=# ofn
let embedded = s:sub(fn, '[\/]$', '') . '/.git'
if s:is_git_dir(embedded)
return s:sub(simplify(fnamemodify(fn . '/.git',':p')),'\W$','')
let full = s:sub(fnamemodify(fn . '/.git', ':p'),'\W$','')
return getftype(full) ==# 'link' ? resolve(full) : simplify(full)
elseif filereadable(embedded)
let line = readfile(embedded,1)[0]
if line =~# '^gitdir: '