From c248cb16fb656c10a8045ac5d453faa5ab5c34c5 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Sun, 4 Dec 2022 18:59:10 +0000 Subject: [PATCH] cronjob githash.php modified to work with ZIP-installed system too --- cronjobs/githash.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cronjobs/githash.php b/cronjobs/githash.php index da8adf31..fd24d943 100755 --- a/cronjobs/githash.php +++ b/cronjobs/githash.php @@ -7,9 +7,15 @@ $path = '../.git/'; if (!is_dir($path)) { return; } -$head = trim(substr(file_get_contents($path . 'HEAD'), 4)); -$hash = trim(file_get_contents(sprintf($path . $head))); - +$head = trim(file_get_contents($path . 'HEAD')); +$refs = trim(substr($head,0,4)); +if ($refs == 'ref:') { + $ref = substr($head,5); + echo($path.$ref."\n"); + $hash = trim(file_get_contents($path . $ref)); +} else { + $hash = $head; +} if (!empty($hash)) { file_put_contents("../githash.txt", $hash); }