Include cwd in fugitive#Execute() result

I guess we should allow for the future possibility the working directory
can be specified.
This commit is contained in:
Tim Pope
2021-08-17 19:59:04 -04:00
parent 40542f1dd1
commit 9b31f4bee5

View File

@@ -637,8 +637,10 @@ function! s:PrepareJob(...) abort
let cmd = flags + args
let tree = s:Tree(dir)
if empty(tree) || index(cmd, '--') == len(cmd) - 1
let dict.cwd = getcwd()
call extend(cmd, git + ['--git-dir=' . FugitiveGitPath(dir)], 'keep')
else
let dict.cwd = FugitiveVimPath(tree)
call extend(cmd, git + ['-C', FugitiveGitPath(tree)], 'keep')
endif
return s:JobOpts(cmd, exec_env) + [dict]