MTrack/SCM/Git/CommitHookBridge.php
if (!preg_match("/^commit\s+(\S+)$/", $line)) {
throw new Exception("unexpected output from git log: $line");
}
if (!preg_match("/^commit\s+(\S+)$/", $line)) {
throw new Exception("unexpected output from git log: $line");
}
+ $this->props = array();
// read key: value properties like Author: / Date:
while (($line = fgets($fp)) !== false) {
$line = rtrim($line);
if (!strlen($line)) break;
if (preg_match("/^(\S+):\s*(.*)\s*$/", $line, $M)) {
// read key: value properties like Author: / Date:
while (($line = fgets($fp)) !== false) {
$line = rtrim($line);
if (!strlen($line)) break;
if (preg_match("/^(\S+):\s*(.*)\s*$/", $line, $M)) {
+ $this->props[$M[1]] = $M[2];
}
}
// read the commit log.
}
}
// read the commit log.