From de3bc28af047e2cc7d575121da9473e2049bc820 Mon Sep 17 00:00:00 2001 From: Rodrigo Butzke Date: Sat, 18 Nov 2023 14:38:37 -0300 Subject: [PATCH] Add 'getPathLastEdit()' to GitRepository --- src/GitRepository.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/GitRepository.php b/src/GitRepository.php index 2ef6f83..504c92a 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -557,6 +557,16 @@ public function setRemoteUrl($name, $url, array $options = NULL) return $this; } + /** + * Get last edit datetime for a path + * @param $path + * @return string returns output + * @throws GitException + */ + public function getPathLastEdit($path) { + return $this->execute("log", ["-1", "--pretty=format:%ci", $path]); + } + /** * @param mixed ...$cmd