]> git.wh0rd.org Git - tt-rss.git/commitdiff
Don't bail out if git gc removed refs
authorTobias Bell <uberspace@tobiasbell.de>
Fri, 8 Jun 2018 20:07:30 +0000 (22:07 +0200)
committerTobias Bell <uberspace@tobiasbell.de>
Fri, 8 Jun 2018 20:07:30 +0000 (22:07 +0200)
include/version.php

index 1d7567bb19281ebfce3faa14a1104ea50a925f5f..2cf7b1ded92f4a9f03553db9a4fdae96a4633665 100644 (file)
@@ -14,6 +14,8 @@
                                if (preg_match("/^ref: (.*)/", $head, $matches)) {
                                        $ref = $matches[1];
 
+                                       if (!file_exists("$root_dir/.git/$ref"))
+                                               return VERSION_STATIC;
                                        $suffix = substr(trim(file_get_contents("$root_dir/.git/$ref")), 0, 7);
                                        $timestamp = filemtime("$root_dir/.git/$ref");