Fix #5661 - MTrack - daily email large and no branch
[web.mtrack] / MTrack / SCM / Git / Event.php
index 41406c0..a6a2a68 100644 (file)
@@ -13,7 +13,9 @@ class MTrack_SCM_Git_Event extends MTrackSCMEvent
 
     /** who committed this revision */
     public $changeby;
-
+    
+    /** branch for this revision */
+    public $branch;
     /** when this revision was committed */
     public $ctime;
 
@@ -34,12 +36,11 @@ class MTrack_SCM_Git_Event extends MTrackSCMEvent
         $lines = explode("\n", $commit);
         $line = array_shift($lines);
 
-        if (!preg_match("/^commit\s+(\S+)$/", $line, $M)) {
+        if (!preg_match("/^commit\s+(\S+)\s+(\S+)$/", $line, $M)) {
             return false;
         }
         $ent->rev = $M[1];
-
-        $ent->branches = array(); // FIXME
+        $ent->branch = $M[2] ;
         $ent->tags = array(); // FIXME
         $ent->files = array();
 
@@ -116,7 +117,7 @@ class MTrack_SCM_Git_Event extends MTrackSCMEvent
         }
         // fixme..
         if (!count($ent->branches)) {
-            $ent->branches[] = 'master';
+            $ent->branches[] = $this->branch; //'master';
         }
         $ent->files_array = array_values($ent->files);
         return $ent;