Skip to content

Commit

Permalink
GitRepository: fixed hasChanges() (see #25)
Browse files Browse the repository at this point in the history
Result of hasChanges() was depend on user locale.
  • Loading branch information
janpecha committed Apr 17, 2018
1 parent 9879e8d commit 6faf555
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,8 @@ public function hasChanges()
->run('git update-index -q --refresh')
->end();

$this->begin();
$lastLine = exec('git status');
$this->end();
return (strpos($lastLine, 'nothing to commit')) === FALSE; // FALSE => changes
$output = $this->extractFromCommand('git status --porcelain');
return !empty($output);
}


Expand Down

0 comments on commit 6faf555

Please sign in to comment.