Merge pull request #1973 from phl0/moreDebug

Make sure git can be executed before using its results
这个提交包含在:
Peter Goodhall 2023-01-31 14:53:57 +00:00 提交者 GitHub
当前提交 a7a0b9610f
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -159,9 +159,10 @@
</div>
</div>
<?php if (file_exists('.git')) { ?>
<div class="card">
<?php
$commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
// only proceed here if git can actually be executed
if ($commitHash != "") {
$commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
$line = trim(exec('git log -n 1 --pretty=%D HEAD'));
$pieces = explode(', ', $line);
@ -175,7 +176,9 @@
$owner = preg_replace('/git@github\.com:(\w+)\/Cloudlog\.git/', '$1', $url);
}
$tag = trim(exec('git describe --tags '.$commitHash));
}
?>
<div class="card">
<div class="card-header">Git Information</div>
<div class="card-body">
<table width="100%">