Fix error parsing worktree out of config

Resolves: https://github.com/tpope/vim-fugitive/issues/1788
This commit is contained in:
Tim Pope
2021-07-11 23:12:13 -04:00
parent 4cdeff8c33
commit 3e2d531322

View File

@@ -211,7 +211,7 @@ function! s:Tree(path) abort
let config = readfile(config_file,'',10) let config = readfile(config_file,'',10)
let wt_config = filter(copy(config),'v:val =~# "^\\s*worktree *="') let wt_config = filter(copy(config),'v:val =~# "^\\s*worktree *="')
if len(wt_config) == 1 if len(wt_config) == 1
let worktree = FugitiveVimPath(matchstr(config[0], '= *\zs.*')) let worktree = FugitiveVimPath(matchstr(wt_config[0], '= *\zs.*'))
else else
call filter(config,'v:val =~# "^\\s*bare *= *false *$"') call filter(config,'v:val =~# "^\\s*bare *= *false *$"')
if len(config) if len(config)