File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ import { Repository } from "../api/git";
99
1010const exec = util . promisify ( _exec ) ;
1111
12+ const DIFF_INDEX_CMD = "diff-index" ;
13+ const DIFF_INDEX_OPTIONS = [
14+ "--name-status" ,
15+ "--find-renames" ,
16+ "--find-copies" ,
17+ "--no-color" ,
18+ ] ;
19+
1220/**
1321 * Run a `git` subcommand and return the result, with stdout and stderr available.
1422 */
@@ -37,20 +45,12 @@ async function _diffIndex(
3745 options : string [ ] = [ ] ,
3846) : Promise < Array < string > > {
3947 const cwd = repository . rootUri . fsPath ;
40- const cmd = "diff-index" ;
41- const fullOptions = [
42- "--name-status" ,
43- "--find-renames" ,
44- "--find-copies" ,
45- "--no-color" ,
46- ...options ,
47- "HEAD" ,
48- ] ;
49-
50- const { stdout, stderr } = await _execute ( cwd , cmd , fullOptions ) ;
48+ const fullOptions = [ ...DIFF_INDEX_OPTIONS , ...options , "HEAD" ] ;
49+
50+ const { stdout, stderr } = await _execute ( cwd , DIFF_INDEX_CMD , fullOptions ) ;
5151
5252 if ( stderr ) {
53- console . debug ( `stderr for 'git ${ cmd } ' command:` , stderr ) ;
53+ console . debug ( `stderr for 'git ${ DIFF_INDEX_CMD } ' command:` , stderr ) ;
5454 }
5555
5656 const lines = stdout . split ( "\n" ) ;
You can’t perform that action at this time.
0 commit comments