33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import * as fs from 'fs' ;
6+ import { promises as fs , exists } from 'fs' ;
77import * as path from 'path' ;
88import * as os from 'os' ;
99import * as cp from 'child_process' ;
1010import * as which from 'which' ;
1111import { EventEmitter } from 'events' ;
1212import iconv = require( 'iconv-lite' ) ;
1313import * as filetype from 'file-type' ;
14- import { assign , groupBy , denodeify , IDisposable , toDisposable , dispose , mkdirp , readBytes , detectUnicodeEncoding , Encoding , onceEvent , splitInChunks , Limiter } from './util' ;
14+ import { assign , groupBy , IDisposable , toDisposable , dispose , mkdirp , readBytes , detectUnicodeEncoding , Encoding , onceEvent , splitInChunks , Limiter } from './util' ;
1515import { CancellationToken , Progress } from 'vscode' ;
1616import { URI } from 'vscode-uri' ;
1717import { detectEncoding } from './encoding' ;
@@ -22,8 +22,6 @@ import { StringDecoder } from 'string_decoder';
2222// https://github.com/microsoft/vscode/issues/65693
2323const MAX_CLI_LENGTH = 30000 ;
2424
25- const readfile = denodeify < string , string | null , string > ( fs . readFile ) ;
26-
2725export interface IGit {
2826 path : string ;
2927 version : string ;
@@ -350,7 +348,7 @@ export class Git {
350348 let folderPath = path . join ( parentPath , folderName ) ;
351349 let count = 1 ;
352350
353- while ( count < 20 && await new Promise ( c => fs . exists ( folderPath , c ) ) ) {
351+ while ( count < 20 && await new Promise ( c => exists ( folderPath , c ) ) ) {
354352 folderName = `${ baseFolderName } -${ count ++ } ` ;
355353 folderPath = path . join ( parentPath , folderName ) ;
356354 }
@@ -1830,7 +1828,7 @@ export class Repository {
18301828 const mergeMsgPath = path . join ( this . repositoryRoot , '.git' , 'MERGE_MSG' ) ;
18311829
18321830 try {
1833- const raw = await readfile ( mergeMsgPath , 'utf8' ) ;
1831+ const raw = await fs . readFile ( mergeMsgPath , 'utf8' ) ;
18341832 return raw . trim ( ) ;
18351833 } catch {
18361834 return undefined ;
@@ -1854,7 +1852,7 @@ export class Repository {
18541852 templatePath = path . join ( this . repositoryRoot , templatePath ) ;
18551853 }
18561854
1857- const raw = await readfile ( templatePath , 'utf8' ) ;
1855+ const raw = await fs . readFile ( templatePath , 'utf8' ) ;
18581856 return raw . trim ( ) ;
18591857
18601858 } catch ( err ) {
@@ -1879,7 +1877,7 @@ export class Repository {
18791877 const gitmodulesPath = path . join ( this . root , '.gitmodules' ) ;
18801878
18811879 try {
1882- const gitmodulesRaw = await readfile ( gitmodulesPath , 'utf8' ) ;
1880+ const gitmodulesRaw = await fs . readFile ( gitmodulesPath , 'utf8' ) ;
18831881 return parseGitmodules ( gitmodulesRaw ) ;
18841882 } catch ( err ) {
18851883 if ( / E N O E N T / . test ( err . message ) ) {
0 commit comments