mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Fix incorrect usage of readfile()
This commit is contained in:
@@ -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 = get(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
|
||||||
@@ -199,7 +199,7 @@ function! s:repo_configured_tree() dict abort
|
|||||||
if !has_key(self,'_tree')
|
if !has_key(self,'_tree')
|
||||||
let self._tree = ''
|
let self._tree = ''
|
||||||
if filereadable(self.dir('config'))
|
if filereadable(self.dir('config'))
|
||||||
let config = readfile(self.dir('config'),10)
|
let config = readfile(self.dir('config'),'',10)
|
||||||
call filter(config,'v:val =~# "^\\s*worktree *="')
|
call filter(config,'v:val =~# "^\\s*worktree *="')
|
||||||
if len(config) == 1
|
if len(config) == 1
|
||||||
let self._tree = matchstr(config[0], '= *\zs.*')
|
let self._tree = matchstr(config[0], '= *\zs.*')
|
||||||
|
|||||||
Reference in New Issue
Block a user