@@ -37,6 +37,7 @@ class UpdateRecipesCommand extends BaseCommand
37
37
private $ configurator ;
38
38
private $ rootDir ;
39
39
private $ githubApi ;
40
+ private $ processExecutor ;
40
41
41
42
public function __construct (/* cannot be type-hinted */ $ flex , Downloader $ downloader , $ httpDownloader , Configurator $ configurator , string $ rootDir )
42
43
{
@@ -166,6 +167,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
166
167
$ symfonyLock ->add ($ packageName , $ newRecipe ->getLock ());
167
168
$ this ->flex ->finish ($ this ->rootDir , $ originalComposerJsonHash );
168
169
170
+ // stage symfony.lock, as all patched files with already be staged
171
+ $ cmdOutput = '' ;
172
+ $ this ->getProcessExecutor ()->execute ('git add symfony.lock ' , $ cmdOutput , $ this ->rootDir );
173
+
169
174
$ io ->write ([
170
175
' <bg=blue;fg=white> </> ' ,
171
176
' <bg=blue;fg=white> Yes! Recipe updated! </> ' ,
@@ -392,14 +397,22 @@ private function askForPackage(IOInterface $io, Lock $symfonyLock): ?string
392
397
393
398
private function isIndexClean (IOInterface $ io ): bool
394
399
{
395
- $ processExecutor = new ProcessExecutor ($ io );
396
400
$ output = '' ;
397
401
398
- $ processExecutor ->execute ('git status --porcelain --untracked-files=no ' , $ output , $ this ->rootDir );
402
+ $ this -> getProcessExecutor () ->execute ('git status --porcelain --untracked-files=no ' , $ output , $ this ->rootDir );
399
403
if ('' !== trim ($ output )) {
400
404
return false ;
401
405
}
402
406
403
407
return true ;
404
408
}
409
+
410
+ private function getProcessExecutor (): ProcessExecutor
411
+ {
412
+ if (null === $ this ->processExecutor ) {
413
+ $ this ->processExecutor = new ProcessExecutor ($ this ->getIO ());
414
+ }
415
+
416
+ return $ this ->processExecutor ;
417
+ }
405
418
}
0 commit comments