]> _ Git - cubist_util.git/commitdiff
wip #5437 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Sep 2022 16:14:45 +0000 (18:14 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Sep 2022 16:14:45 +0000 (18:14 +0200)
src/CommandLine/Git.php

index 9eb3f9c61626599286f29d8750bdd2ff1c99cd52..4ee4503d3a72c582863540ee0ca0c5d4519d3ac6 100644 (file)
@@ -8,6 +8,21 @@ class Git extends CommandLine
 {
     protected $_repos;
 
+    public static function executeCommands($repos, $commands)
+    {
+        $res = [];
+        foreach ($commands as $command) {
+            $res[] = self::executeCommand($repos, $command);
+        }
+        return $res;
+    }
+
+    public static function executeCommand($repos, $command)
+    {
+        $git = new self($repos);
+        return $git->executeCmd($command);
+    }
+
     public function __construct($repos, $output = null, $error = true)
     {
         parent::__construct('git', $output, $error);