Пример #1
0
 /**
  * @covers \Bit3\GitPhp\GitRepository::status
  * @covers \Bit3\GitPhp\Command\StatusCommandBuilder::getStatus
  */
 public function testStatusOnUninitializedRepository()
 {
     $this->setExpectedException('Bit3\\GitPhp\\GitException');
     $this->uninitializedGitRepository->status()->getStatus();
 }
 /**
  * Check if the current file path is a file and if so, if it has staged modifications.
  *
  * @param string        $path A path obtained via a prior call to AuthorExtractor::getFilePaths().
  *
  * @param GitRepository $git  The repository to extract all files from.
  *
  * @return bool
  */
 private function isDirtyFile($path, $git)
 {
     if (!is_file($path)) {
         return false;
     }
     $status = $git->status()->short()->getIndexStatus();
     $relPath = substr($path, strlen($git->getRepositoryPath()) + 1);
     if (isset($status[$relPath]) && $status[$relPath]) {
         return true;
     }
     return false;
 }