File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,9 @@ export class Svn {
9595 args . push ( "--password" , options . password ) ;
9696 }
9797
98+ let encoding = options . encoding || "utf8" ;
99+ delete options . encoding ;
100+
98101 const process = cp . spawn ( this . svnPath , args , options ) ;
99102
100103 const disposables : IDisposable [ ] = [ ] ;
@@ -138,10 +141,6 @@ export class Svn {
138141
139142 dispose ( disposables ) ;
140143
141- let encoding = workspace
142- . getConfiguration ( "files" )
143- . get < string > ( "encoding" , "utf8" ) ;
144-
145144 // SVN with '--xml' always return 'UTF-8', and jschardet detects this encoding: 'TIS-620'
146145 if ( args . includes ( "--xml" ) ) {
147146 encoding = "utf8" ;
Original file line number Diff line number Diff line change 11import * as fs from "fs" ;
22import * as path from "path" ;
3+ import { Uri , workspace } from "vscode" ;
34import {
45 ICpOptions ,
56 IExecutionResult ,
@@ -130,6 +131,7 @@ export class Repository {
130131 revision ?: string ,
131132 options : ICpOptions = { }
132133 ) : Promise < string > {
134+ const uri = Uri . file ( file ) ;
133135 file = this . removeAbsolutePath ( file ) ;
134136 const args = [ "cat" ] ;
135137
@@ -147,7 +149,11 @@ export class Repository {
147149 args . push ( file ) ;
148150 }
149151
150- const result = await this . exec ( args ) ;
152+ const encoding = workspace
153+ . getConfiguration ( "files" , uri )
154+ . get < string > ( "encoding" , "utf8" ) ;
155+
156+ const result = await this . exec ( args , { encoding } ) ;
151157
152158 return result . stdout ;
153159 }
You can’t perform that action at this time.
0 commit comments