1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 21:26:43 +02:00

Make sure MercurialProcessor fails gracefully

This commit is contained in:
Jordi Boggiano
2016-09-29 09:17:31 +02:00
parent d72b886978
commit 6bf91fa40a

View File

@@ -51,9 +51,13 @@ class MercurialProcessor
} }
$result = explode(' ', trim(`hg id -nb`)); $result = explode(' ', trim(`hg id -nb`));
return self::$cache = array( if (count($result) >= 3) {
'branch' => $result[1], return self::$cache = array(
'revision' => $result[2], 'branch' => $result[1],
); 'revision' => $result[2],
);
}
return self::$cache = array();
} }
} }