Guard against blank .git file
Let's see you break it now.
This commit is contained in:
parent
8ecc9b9e11
commit
bc3ffa6b44
@ -118,7 +118,7 @@ function! fugitive#extract_git_dir(path) abort
|
|||||||
elseif type ==# 'link' && fugitive#is_git_dir(dir)
|
elseif type ==# 'link' && fugitive#is_git_dir(dir)
|
||||||
return resolve(dir)
|
return resolve(dir)
|
||||||
elseif type !=# '' && filereadable(dir)
|
elseif type !=# '' && filereadable(dir)
|
||||||
let line = readfile(dir, 1)[0]
|
let line = get(readfile(dir, 1), 0, '')
|
||||||
if line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1])
|
if line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1])
|
||||||
return line[8:-1]
|
return line[8:-1]
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user