Fix #5661 - MTrack - daily email large and no branch
authorAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 10:32:24 +0000 (18:32 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 15 Jan 2019 10:32:24 +0000 (18:32 +0800)
MTrack/SCM/Git/CommitHookBridge.php

index 2c5dee2..328c93b 100644 (file)
@@ -26,7 +26,7 @@ class MTrack_SCM_Git_CommitHookBridge extends  IMTrackCommitHookBridge
         while (($line = fgets(STDIN)) !== false) {
             echo "got: $line\n";
             list($old, $new, $ref) = explode(' ', trim($line), 3);
-            $this->branch = $ref;
+            $this->branch = preg_replace('#^refs/heads/#','', $ref);
             $this->commits[] = $new;
   
             if (preg_match('/^0+$/',$old)) {