mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Add tests for git
This commit is contained in:
parent
536906ed46
commit
e6597256a0
|
|
@ -67,6 +67,6 @@ class Branch
|
|||
*/
|
||||
public function setName(string $name) /* : void */
|
||||
{
|
||||
$this->name = escapeshellarg($name);
|
||||
$this->name = $name;
|
||||
}
|
||||
}
|
||||
|
|
@ -103,6 +103,7 @@ class Commit
|
|||
$this->author = new Author();
|
||||
$this->branch = new Branch();
|
||||
$this->tag = new Tag();
|
||||
$this->repository = new Repository(realpath(__DIR__ . '/../../../../../'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ use phpOMS\System\File\PathException;
|
|||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Git
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ class Repository
|
|||
public function __construct(string $path)
|
||||
{
|
||||
$this->setPath($path);
|
||||
$this->branch = $this->getActiveBranch();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -115,15 +114,11 @@ class Repository
|
|||
*/
|
||||
public function getActiveBranch() : Branch
|
||||
{
|
||||
if (!isset($this->branch)) {
|
||||
$branches = $this->getBranches();
|
||||
$active = preg_grep('/^\*/', $branches);
|
||||
reset($active);
|
||||
$branches = $this->getBranches();
|
||||
$active = preg_grep('/^\*/', $branches);
|
||||
reset($active);
|
||||
|
||||
$this->branch = new Branch(current($active));
|
||||
}
|
||||
|
||||
return $this->branch;
|
||||
return new Branch(current($active));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Tag
|
|||
*/
|
||||
public function __construct(string $name = '')
|
||||
{
|
||||
$this->name = escapeshellarg($name);
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -75,7 +75,7 @@ class Tag
|
|||
*/
|
||||
public function setMessage(string $message) /* : void */
|
||||
{
|
||||
$this->message = escapeshellarg($message);
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user