mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-12 13:23:53 -05:00
Use git -C instead of cd
This commit is contained in:
@@ -308,9 +308,8 @@ function! s:stage(hunk_diff)
|
||||
write
|
||||
let path = gitgutter#utility#repo_path(bufnr, 1)
|
||||
" Add file to index.
|
||||
let cmd = gitgutter#utility#cd_cmd(bufnr,
|
||||
\ gitgutter#git().' add '.
|
||||
\ gitgutter#utility#shellescape(gitgutter#utility#filename(bufnr)))
|
||||
let cmd = gitgutter#git(bufnr).' add '.
|
||||
\ gitgutter#utility#shellescape(gitgutter#utility#filename(bufnr))
|
||||
let [_, error_code] = gitgutter#utility#system(cmd)
|
||||
else
|
||||
return
|
||||
@@ -320,7 +319,7 @@ function! s:stage(hunk_diff)
|
||||
let diff = s:adjust_header(bufnr, a:hunk_diff)
|
||||
" Apply patch to index.
|
||||
let [_, error_code] = gitgutter#utility#system(
|
||||
\ gitgutter#utility#cd_cmd(bufnr, gitgutter#git().' apply --cached --unidiff-zero - '),
|
||||
\ gitgutter#git(bufnr).' apply --cached --unidiff-zero - ',
|
||||
\ diff)
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user