From: Vincent Vanwaelscappel Date: Tue, 6 Dec 2022 07:17:50 +0000 (+0100) Subject: wip #5627 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=cdc2f55944a2e35efac4f5864a395ee68717fbda;p=cubist_util.git wip #5627 @0.5 --- diff --git a/src/CommandLine/Git.php b/src/CommandLine/Git.php index 4ee4503..1a18e6e 100644 --- a/src/CommandLine/Git.php +++ b/src/CommandLine/Git.php @@ -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; + } }