File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,18 @@ async function gitCommandCore(options: GitCommandOptions, ...args: any[]): Promi
8484 Logger . log ( `Awaiting${ command } ` ) ;
8585 }
8686
87- const s = await promise ;
88- pendingCommands . delete ( command ) ;
89-
90- Logger . log ( `Completed${ command } ` ) ;
87+ let data : string ;
88+ try {
89+ data = await promise ;
90+ }
91+ finally {
92+ pendingCommands . delete ( command ) ;
93+ Logger . log ( `Completed${ command } ` ) ;
94+ }
9195
92- if ( opts . encoding === 'utf8' || opts . encoding === 'binary' ) return s ;
96+ if ( opts . encoding === 'utf8' || opts . encoding === 'binary' ) return data ;
9397
94- return iconv . decode ( Buffer . from ( s , 'binary' ) , opts . encoding ) ;
98+ return iconv . decode ( Buffer . from ( data , 'binary' ) , opts . encoding ) ;
9599}
96100
97101function gitCommandDefaultErrorHandler ( ex : Error , options : GitCommandOptions , ...args : any [ ] ) : string {
You can’t perform that action at this time.
0 commit comments