diff --git a/index.php b/index.php index a924e59..0a617c6 100644 --- a/index.php +++ b/index.php @@ -30,15 +30,6 @@ return trim($res[array_key_last($res)]); } - function get_commit_msg (string $fp) : string { - $res = file_get_contents($fp.".git/logs/refs/heads/".git_branch($fp)); - $res = explode("\n", $res); - $res = $res[array_key_last($res)-1]; - $res = strstr($res, "commit: "); - $res = str_replace("commit: ", "", $res); - return trim($res); - } - function ls (string $fp = "") : array|bool { return array_diff(scandir(PDIR.$fp), ["..", ".", ".git"]); } @@ -70,10 +61,7 @@ ?> Branch: ".git_branch($proot).""; - echo "

Last commit: ".get_commit_msg($proot)."

"; - } + if ($isgit) echo "

Branch: ".git_branch($proot)."

"; if (!is_dir(PDIR.$path)) { echo "
".cat($path)."
"; }