Commit f2a390ca authored by Stefan Galinski's avatar Stefan Galinski 🎮

[BUGFIX] Show the correct new mode for files

parent daf0f15c
......@@ -209,7 +209,25 @@ class Webhook {
$diffUrl = $this->settings['Configuration']['Gitlab']['apiUrl'] . '/projects/' . $this->request['project_id'] . '/repository/commits/' . $commit['id'] . '/diff?private_token=' . $this->settings['Configuration']['Gitlab']['authToken'];
$content = file_get_contents($diffUrl);
$contentJson = json_decode($content);
self::$diffCache[$commit['id']] = $contentJson[0]->diff;
// [old_path] => Classes/Webhook.php
// [new_path] => Classes/Webhook.php
// [a_mode] => 100644
// [b_mode] => 100644
// [new_file] =>
// [renamed_file] =>
// [deleted_file] =>
// [diff] =>
$output = '';
foreach ($contentJson as $diff) {
$output .= "\n" . 'Old Path: ' . $diff->old_path . "\n";
$output .= 'New Path: ' . $diff->new_path . "\n";
$output .= 'Old Mode: ' . $diff->a_mode . "\n";
$output .= 'New Mode: ' . $diff->b_mode . "\n";
$output .= $diff->diff . "\n\n--------------------\n\n";
}
self::$diffCache[$commit['id']] = $output;
//error_log(print_r($contentJson, TRUE));
//die();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment