Skip to content

Commit

Permalink
Merge pull request #85 from c9s/patch-1
Browse files Browse the repository at this point in the history
Add shortcut methods: isClean, isDirty
  • Loading branch information
matteosister committed Aug 2, 2015
2 parents 36c97ac + 1725292 commit 5314845
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/GitElephant/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,26 @@ public function getIndexStatus()
{
return StatusIndex::get($this);
}

/**
* isClean Return true if the repository is not dirty.
*
* @return boolean
*/
public function isClean()
{
return $this->getStatus()->all()->isEmpty();
}

/**
* isDirty Return true if the repository has some modified files.
*
* @return boolean
*/
public function isDirty()
{
return !$this->isClean();
}

/**
* Get the repository status as a string
Expand Down

0 comments on commit 5314845

Please sign in to comment.