Skip to content

Commit 9bd8732

Browse files
committed
Reworking check for a clean index
1 parent a58abf5 commit 9bd8732

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Command/UpdateRecipesCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,15 @@ private function askForPackage(IOInterface $io, Lock $symfonyLock): ?string
390390
private function isIndexClean(IOInterface $io): bool
391391
{
392392
$processExecutor = new ProcessExecutor($io);
393-
if (0 !== $processExecutor->execute('git diff-files --quiet --ignore-submodules')) {
393+
$output = '';
394+
395+
$processExecutor->execute('git diff --cached --name-only', $output, $this->rootDir);
396+
if ('' !== trim($output)) {
394397
return false;
395398
}
396399

397-
if (0 !== $processExecutor->execute('git diff-index --cached --quiet --ignore-submodules HEAD --')) {
400+
$processExecutor->execute('git diff --name-only', $output, $this->rootDir);
401+
if ('' !== trim($output)) {
398402
return false;
399403
}
400404

0 commit comments

Comments
 (0)