Skip to content

Commit

Permalink
GitRepository: hasChanges() calls git update-index -q --refresh
Browse files Browse the repository at this point in the history
See #17
  • Loading branch information
ribeiropaulor authored and janpecha committed Feb 8, 2018
1 parent 19c5c1d commit 26edd0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ public function commit($message, $params = NULL)
*/
public function hasChanges()
{
// Make sure the `git status` gets a refreshed look at the working tree.
$this->begin()
->run('git update-index -q --refresh')
->end();

$this->begin();
$lastLine = exec('git status');
$this->end();
Expand Down

0 comments on commit 26edd0d

Please sign in to comment.