From cdc2f55944a2e35efac4f5864a395ee68717fbda Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 6 Dec 2022 08:17:50 +0100 Subject: [PATCH] wip #5627 @0.5 --- src/CommandLine/Git.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; + } } -- 2.39.5