Skip to content

Commit

Permalink
Set --git-dir if relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
rbong committed Sep 18, 2024
1 parent 76cdccb commit 5f649d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/flog/git.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ endfunction
function! flog#git#GetCommand(cmd = []) abort
let l:cmd = ['git']

let l:workdir = flog#git#GetWorkdir()
let l:git_dir = flog#backend#GetGitDir()
let l:workdir = flog#git#GetWorkdir(l:git_dir)
if !empty(l:workdir)
let l:cmd += ['-C', flog#shell#Escape(l:workdir)]
endif
if !empty(l:git_dir)
let l:cmd += ['--git-dir', flog#shell#Escape(l:git_dir)]
endif

call extend(l:cmd, a:cmd)

Expand Down

0 comments on commit 5f649d2

Please sign in to comment.