Browse Source

Fixes missing git command logging

main
Eric Amodio 7 years ago
parent
commit
34a490725f
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/git/git.ts

+ 2
- 1
src/git/git.ts View File

@ -64,6 +64,8 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
// See https://stackoverflow.com/questions/4144417/how-to-handle-asian-characters-in-file-names-in-git-on-os-x // See https://stackoverflow.com/questions/4144417/how-to-handle-asian-characters-in-file-names-in-git-on-os-x
args.splice(0, 0, '-c', 'core.quotepath=false', '-c', 'color.ui=false'); args.splice(0, 0, '-c', 'core.quotepath=false', '-c', 'color.ui=false');
Logger.log('git', ...args, ` cwd='${options.cwd}'`);
const opts = { encoding: 'utf8', ...options }; const opts = { encoding: 'utf8', ...options };
const s = await spawnPromise(git.path, args, { const s = await spawnPromise(git.path, args, {
cwd: options.cwd, cwd: options.cwd,
@ -71,7 +73,6 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
encoding: (opts.encoding === 'utf8') ? 'utf8' : 'binary' encoding: (opts.encoding === 'utf8') ? 'utf8' : 'binary'
} as SpawnOptions); } as SpawnOptions);
Logger.log('git', ...args, ` cwd='${options.cwd}'`);
if (opts.encoding === 'utf8' || opts.encoding === 'binary') return s; if (opts.encoding === 'utf8' || opts.encoding === 'binary') return s;
return iconv.decode(Buffer.from(s, 'binary'), opts.encoding); return iconv.decode(Buffer.from(s, 'binary'), opts.encoding);

Loading…
Cancel
Save