Attribute changed MTrack/SCM/Git/CommitHookBridge.php
authorAlan Knowles <alan@roojs.com>
Wed, 7 Nov 2018 01:54:15 +0000 (09:54 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 7 Nov 2018 01:54:15 +0000 (09:54 +0800)
MTrack/SCM/Git/CommitHookBridge.php

index ecdb9c2..b16178c 100644 (file)
@@ -28,6 +28,10 @@ class MTrack_SCM_Git_CommitHookBridge extends  IMTrackCommitHookBridge
             list($old, $new, $ref) = explode(' ', trim($line), 3);
             $this->commits[] = $new;
   
+            if (preg_match('/^0+$/',$old)) {
+                continue; // it's a new branch - ignore..
+            }
+  
             $fp = $this->repo->git(
                 'log', '--no-color', '--name-status',
                 '--date=rfc',  "$old..$new"); //$ref, used to be in here??  - but it breaks stuff...