- Merging codes

This commit is contained in:
Dave M. 2023-10-12 18:50:17 +00:00
parent 8d22132ef5
commit 3f92287829
1 changed files with 2 additions and 2 deletions

View File

@ -83,11 +83,11 @@ return [
$gitdir = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . ".git" . DIRECTORY_SEPARATOR;
if ( file_exists($gitdir . "HEAD") ) {
if (false !== ($currentBranch = file_get_contents($gitdir . "HEAD"))) {
if (false !== ($currentBranch = file_get_contents($gitdir . "HEAD"))) {
$file = explode(": ", $currentBranch)[1];
$path = $gitdir . str_replace("/", DIRECTORY_SEPARATOR, trim($file, " \t\n\r"));
return trim(file_get_contents($path), " \t\n\r");
return file_exists($path) ? trim(file_get_contents($path), " \t\n\r") : null;
}
}