From 9b31f4bee5e393838a070a650f0523368fb17410 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 17 Aug 2021 19:59:04 -0400 Subject: [PATCH] Include cwd in fugitive#Execute() result I guess we should allow for the future possibility the working directory can be specified. --- autoload/fugitive.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a4a1831..8db0a70 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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]