This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,8 @@ public async Task SyncSubmodules(ILocalRepositoryModel repository)
196196 }
197197
198198 var output = new StringWriter ( CultureInfo . InvariantCulture ) ;
199- exitCode = await SyncSubmodules ( repository . LocalPath , line => output . WriteLine ( line ) ) ;
199+ var progress = new Progress < string > ( line => output . WriteLine ( line ) ) ;
200+ exitCode = await SyncSubmodules ( repository . LocalPath , progress ) ;
200201 if ( exitCode != 0 )
201202 {
202203 var message = output . ToString ( ) ;
@@ -205,7 +206,7 @@ public async Task SyncSubmodules(ILocalRepositoryModel repository)
205206 }
206207
207208 // LibGit2Sharp has limited submodule support so shelling out Git.exe for submodule commands.
208- async Task < int > SyncSubmodules ( string workingDir , Action < string > progress = null )
209+ async Task < int > SyncSubmodules ( string workingDir , IProgress < string > progress )
209210 {
210211 var cmdArguments = "/C git submodule init & git submodule sync --recursive & git submodule update --recursive" ;
211212 var startInfo = new ProcessStartInfo ( "cmd" , cmdArguments )
@@ -243,12 +244,12 @@ static int Where(string fileName)
243244 }
244245 }
245246
246- static async Task ReadLinesAsync ( TextReader reader , Action < string > progress )
247+ static async Task ReadLinesAsync ( TextReader reader , IProgress < string > progress )
247248 {
248249 string line ;
249250 while ( ( line = await reader . ReadLineAsync ( ) ) != null )
250251 {
251- progress ? . Invoke ( line ) ;
252+ progress . Report ( line ) ;
252253 }
253254 }
254255
You can’t perform that action at this time.
0 commit comments