mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Added support for encodings for Git.
Fixes #21146 **Bug** Git always uses utf8 encoding for retrieving file contents. **Fix** Pass the 'files.encoding' configuration property to the git-extension and use this encoding to decode git output.
This commit is contained in:
@@ -28,6 +28,7 @@ async function init(context: ExtensionContext, disposables: Disposable[]): Promi
|
||||
const outputChannel = window.createOutputChannel('Git');
|
||||
disposables.push(outputChannel);
|
||||
|
||||
const configFiles = workspace.getConfiguration('files');
|
||||
const config = workspace.getConfiguration('git');
|
||||
const enabled = config.get<boolean>('enabled') === true;
|
||||
const workspaceRootPath = workspace.rootPath;
|
||||
@@ -44,7 +45,7 @@ async function init(context: ExtensionContext, disposables: Disposable[]): Promi
|
||||
return;
|
||||
}
|
||||
|
||||
const model = new Model(git, workspaceRootPath);
|
||||
const model = new Model(git, workspaceRootPath, configFiles.get<string>('encoding'));
|
||||
|
||||
outputChannel.appendLine(localize('using git', "Using git {0} from {1}", info.version, info.path));
|
||||
git.onOutput(str => outputChannel.append(str), null, disposables);
|
||||
|
||||
Reference in New Issue
Block a user