mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Git - fix encoding issue with stage selected ranges (#236484)
This commit is contained in:
@@ -1657,9 +1657,9 @@ export class Repository {
|
||||
await this.exec(args);
|
||||
}
|
||||
|
||||
async stage(path: string, data: string): Promise<void> {
|
||||
async stage(path: string, data: string, encoding: string): Promise<void> {
|
||||
const child = this.stream(['hash-object', '--stdin', '-w', '--path', sanitizePath(path)], { stdio: [null, null, null] });
|
||||
child.stdin!.end(data, 'utf8');
|
||||
child.stdin!.end(iconv.encode(data, encoding));
|
||||
|
||||
const { exitCode, stdout } = await exec(child);
|
||||
const hash = stdout.toString('utf8');
|
||||
|
||||
Reference in New Issue
Block a user