@@ -18,10 +18,6 @@ export interface GitServiceEvents {
1818
1919@injectable ( )
2020export class GitService extends TypedEventEmitter < GitServiceEvents > {
21- constructor ( ) {
22- super ( ) ;
23- }
24-
2521 public async detectRepo (
2622 directoryPath : string ,
2723 ) : Promise < DetectRepoResult | null > {
@@ -71,9 +67,13 @@ export class GitService extends TypedEventEmitter<GitServiceEvents> {
7167
7268 emitProgress ( "cloning" , `Starting clone of ${ repoUrl } ...` ) ;
7369
74- const gitProcess = spawn ( "git" , [ "clone" , "--progress" , repoUrl , targetPath ] , {
75- stdio : [ "ignore" , "pipe" , "pipe" ] ,
76- } ) ;
70+ const gitProcess = spawn (
71+ "git" ,
72+ [ "clone" , "--progress" , repoUrl , targetPath ] ,
73+ {
74+ stdio : [ "ignore" , "pipe" , "pipe" ] ,
75+ } ,
76+ ) ;
7777
7878 gitProcess . stderr . on ( "data" , ( data : Buffer ) => {
7979 const output = data . toString ( ) ;
@@ -107,9 +107,13 @@ export class GitService extends TypedEventEmitter<GitServiceEvents> {
107107
108108 public async getRemoteUrl ( directoryPath : string ) : Promise < string | null > {
109109 try {
110- const { stdout } = await execFileAsync ( "git" , [ "remote" , "get-url" , "origin" ] , {
111- cwd : directoryPath ,
112- } ) ;
110+ const { stdout } = await execFileAsync (
111+ "git" ,
112+ [ "remote" , "get-url" , "origin" ] ,
113+ {
114+ cwd : directoryPath ,
115+ } ,
116+ ) ;
113117 return stdout . trim ( ) ;
114118 } catch {
115119 return null ;
@@ -118,9 +122,13 @@ export class GitService extends TypedEventEmitter<GitServiceEvents> {
118122
119123 public async getCurrentBranch ( directoryPath : string ) : Promise < string | null > {
120124 try {
121- const { stdout } = await execFileAsync ( "git" , [ "branch" , "--show-current" ] , {
122- cwd : directoryPath ,
123- } ) ;
125+ const { stdout } = await execFileAsync (
126+ "git" ,
127+ [ "branch" , "--show-current" ] ,
128+ {
129+ cwd : directoryPath ,
130+ } ,
131+ ) ;
124132 return stdout . trim ( ) ;
125133 } catch {
126134 return null ;
0 commit comments