Skip to content

Commit eb494b4

Browse files
committed
remove encoding detection
1 parent dd04396 commit eb494b4

3 files changed

Lines changed: 7 additions & 26 deletions

File tree

extensions/git/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
]
9292
},
9393
"dependencies": {
94-
"autodetect-decoder-stream": "^1.0.0",
9594
"denodeify": "^1.2.1",
9695
"lodash": "^4.17.2",
9796
"mime": "^1.3.4",

extensions/git/src/git.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import * as _ from 'lodash';
1515
import { EventEmitter, Event } from 'vscode';
1616
import * as nls from 'vscode-nls';
1717
import * as mime from 'mime';
18-
import * as AutoDetectDecoderStream from 'autodetect-decoder-stream';
1918

2019
const localize = nls.loadMessageBundle(__filename);
2120
const readdir = denodeify(fs.readdir);
@@ -177,23 +176,20 @@ export async function exec(child: cp.ChildProcess, defaultEncoding = 'utf8'): Pr
177176
disposables.push(toDisposable(() => ee.removeListener(name, fn)));
178177
};
179178

180-
const stdoutStream = child.stdout.pipe(new AutoDetectDecoderStream({ defaultEncoding }));
181-
const stderrStream = child.stderr.pipe(new AutoDetectDecoderStream({ defaultEncoding }));
182-
183179
const [exitCode, stdout, stderr] = await Promise.all<any>([
184180
new Promise<number>((c, e) => {
185181
once(child, 'error', e);
186182
once(child, 'exit', c);
187183
}),
188184
new Promise<string>(c => {
189-
let buffers: string[] = [];
190-
on(stdoutStream, 'data', b => buffers.push(b));
191-
once(stdoutStream, 'close', () => c(buffers.join()));
185+
const buffers: string[] = [];
186+
on(child.stdout, 'data', b => buffers.push(b));
187+
once(child.stdout, 'close', () => c(buffers.join()));
192188
}),
193189
new Promise<string>(c => {
194-
let buffers: string[] = [];
195-
on(stderrStream, 'data', b => buffers.push(b));
196-
once(stderrStream, 'close', () => c(buffers.join()));
190+
const buffers: string[] = [];
191+
on(child.stderr, 'data', b => buffers.push(b));
192+
once(child.stderr, 'close', () => c(buffers.join()));
197193
})
198194
]);
199195

@@ -457,6 +453,7 @@ export class Repository {
457453

458454
return await this.doBuffer(object);
459455

456+
// TODO@joao
460457
// return new Promise((c, e) => {
461458
// detectMimesFromStream(child.stdout, null, (err, result) => {
462459
// if (err) {

extensions/git/src/typings/globals/autodetect-decoder-stream/index.d.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)