Fix constructing Git shell commands

This commit is contained in:
Tim Pope
2021-08-19 13:50:42 -04:00
parent eafb44a720
commit e93d45e4ce

View File

@@ -673,8 +673,8 @@ function! s:BuildShell(dir, env, git, args) abort
call insert(cmd, '--git-dir=' . FugitiveGitPath(a:dir))
else
call extend(cmd, ['-C', FugitiveGitPath(tree)], 'keep')
if !s:cpath(tree . '/.git', dir)
call extend(cmd, ['--git-dir=' . FugitiveGitPath(dir)], 'keep')
if !s:cpath(tree . '/.git', a:dir)
call extend(cmd, ['--git-dir=' . FugitiveGitPath(a:dir)], 'keep')
endif
endif
return pre . join(map(a:git + cmd, 's:shellesc(v:val)'))