]> _ Git - cubist_util.git/commitdiff
wip #5627 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Dec 2022 07:17:50 +0000 (08:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 6 Dec 2022 07:17:50 +0000 (08:17 +0100)
src/CommandLine/Git.php

index 4ee4503d3a72c582863540ee0ca0c5d4519d3ac6..1a18e6e4780907be30de21df7ed96fa8472a7bf5 100644 (file)
@@ -58,4 +58,18 @@ class Git extends CommandLine
         }
         return array_keys($branches);
     }
+
+    /**
+     * @param $repos
+     * @return bool
+     */
+    public static function pull($repos, $restoreMtime = false)
+    {
+        $res=self::executeCommand($repos,'pull');
+        $changes = (trim($res) !== 'Already up to date.');
+        if($restoreMtime && $changes){
+            self::executeCommand($repos,'restore-mtime');
+        }
+        return $changes;
+    }
 }