Merge pull request #2719 from Citadel-Station-13/upstream-merge-30578

[MIRROR] Caches the github diff for has_tree_been_edited
This commit is contained in:
LetterJay
2017-09-12 18:18:11 -05:00
committed by GitHub
@@ -358,13 +358,18 @@ function auto_update($payload){
fclose($code_file);
}
$github_diff = null;
function has_tree_been_edited($payload, $tree){
//go to the diff url
$url = $payload['pull_request']['diff_url'];
$content = file_get_contents($url);
global $github_diff;
if ($github_diff === null) {
//go to the diff url
$url = $payload['pull_request']['diff_url'];
$github_diff = file_get_contents($url);
}
//find things in the _maps/map_files tree
//e.g. diff --git a/_maps/map_files/Cerestation/cerestation.dmm b/_maps/map_files/Cerestation/cerestation.dmm
return $content !== FALSE && strpos($content, 'diff --git a/' . $tree) !== FALSE;
return $github_diff !== FALSE && strpos($github_diff, 'diff --git a/' . $tree) !== FALSE;
}
function checkchangelog($payload, $merge = false, $compile = true) {