diff --git a/Utils/Git/Branch.php b/Utils/Git/Branch.php index 598da6af4..fa1f47e56 100644 --- a/Utils/Git/Branch.php +++ b/Utils/Git/Branch.php @@ -67,6 +67,6 @@ class Branch */ public function setName(string $name) /* : void */ { - $this->name = escapeshellarg($name); + $this->name = $name; } } \ No newline at end of file diff --git a/Utils/Git/Commit.php b/Utils/Git/Commit.php index 4801985ef..b31aa5765 100644 --- a/Utils/Git/Commit.php +++ b/Utils/Git/Commit.php @@ -103,6 +103,7 @@ class Commit $this->author = new Author(); $this->branch = new Branch(); $this->tag = new Tag(); + $this->repository = new Repository(realpath(__DIR__ . '/../../../../../')); } /** diff --git a/Utils/Git/Git.php b/Utils/Git/Git.php index 4b4d599e1..f8c214164 100644 --- a/Utils/Git/Git.php +++ b/Utils/Git/Git.php @@ -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 { diff --git a/Utils/Git/Repository.php b/Utils/Git/Repository.php index a096f8fe2..e5b74d4d5 100644 --- a/Utils/Git/Repository.php +++ b/Utils/Git/Repository.php @@ -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)); } /** diff --git a/Utils/Git/Tag.php b/Utils/Git/Tag.php index f538153fe..26ee8999f 100644 --- a/Utils/Git/Tag.php +++ b/Utils/Git/Tag.php @@ -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; } /**