/**
  * Retrieve the latest tag from a branch.
  *
  * @param string $branch The branch name to retrieve the tag from.
  *
  * @return null|string Returns null when no tag has been found, the tag name otherwise.
  */
 protected function getTagFromBranch($branch)
 {
     $git = new GitRepository($this->input->getArgument('git-dir'));
     $tag = trim($git->describe()->tags()->always()->execute($branch));
     $hash = trim($git->revParse()->short(false)->execute($branch));
     return $hash !== $tag ? $tag : null;
 }
 /**
  * @covers \ContaoCommunityAlliance\BuildSystem\Repository\GitRepository::describe
  * @covers \ContaoCommunityAlliance\BuildSystem\Repository\Command\DescribeCommandBuilder::execute
  */
 public function testDescribeOnUninitializedRepository()
 {
     $this->setExpectedException('ContaoCommunityAlliance\\BuildSystem\\Repository\\GitException');
     $this->uninitializedGitRepository->describe()->execute();
 }