mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-43355_master' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
2df83c2ea8
@ -644,18 +644,23 @@ abstract class testing_util {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ref = file_get_contents("$CFG->dirroot/.git/HEAD");
|
||||
if ($ref === false) {
|
||||
$headcontent = file_get_contents("$CFG->dirroot/.git/HEAD");
|
||||
if ($headcontent === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ref = trim($ref);
|
||||
$headcontent = trim($headcontent);
|
||||
|
||||
if (strpos($ref, 'ref: ') !== 0) {
|
||||
// If it is pointing to a hash we return it directly.
|
||||
if (strlen($headcontent) === 40) {
|
||||
return $headcontent;
|
||||
}
|
||||
|
||||
if (strpos($headcontent, 'ref: ') !== 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ref = substr($ref, 5);
|
||||
$ref = substr($headcontent, 5);
|
||||
|
||||
if (!file_exists("$CFG->dirroot/.git/$ref")) {
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user