- Merging codes
This commit is contained in:
parent
8d22132ef5
commit
3f92287829
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue