Commit:    00fd9038da096f1e283f85bab24e789bd84523af
Author:    Alexander Moskaliov <ir...@php.net>         Fri, 23 Mar 2012 
09:53:30 +0400
Parents:   b6b01b9106a29aefe97dcab12c39501ff4ecdb69
Branches:  master

Link:       
http://git.php.net/?p=karma.git;a=commitdiff;h=00fd9038da096f1e283f85bab24e789bd84523af

Log:
Remove commit data cache.

This cache was added because same commits data was
used in branch,tag and commit mails. Now we remove
branch mails, so we not need cache more.

Changed paths:
  M  lib/Git/PostReceiveHook.php


Diff:
00fd9038da096f1e283f85bab24e789bd84523af
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index 11d3996..7a84f5f 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -13,7 +13,6 @@ class PostReceiveHook extends ReceiveHook
     private $alreadyExistsBranches = [];
     private $updatedBranches = [];
     private $revisions = [];
-    private $commitsData = [];
 
     private $allBranches = [];
 
@@ -428,22 +427,20 @@ class PostReceiveHook extends ReceiveHook
      */
     private function getCommitInfo($revision)
     {
-        if (!isset($this->commitsData[$revision])) {
-            $raw = \Git::gitExec('rev-list -n 1 
--format="%%P%%n%%an%%n%%ae%%n%%aD%%n%%cn%%n%%ce%%n%%cD%%n%%s%%n%%B" %s', 
escapeshellarg($revision));
-            $raw = explode("\n", trim($raw), 10); //10 elements separated by 
\n, last element - log message, first(skipped) element - "commit sha"
-            $this->commitsData[$revision] = [
-                'parents'           => $raw[1],  // %P
-                'author'            => $raw[2],  // %an
-                'author_email'      => $raw[3],  // %ae
-                'author_date'       => $raw[4],  // %aD
-                'committer'         => $raw[5],  // %cn
-                'committer_email'   => $raw[6],  // %ce
-                'committer_date'    => $raw[7],  // %cD
-                'subject'           => $raw[8],  // %s
-                'log'               => $raw[9]   // %B
-            ];
-        }
-        return $this->commitsData[$revision];
+        $raw = \Git::gitExec('rev-list -n 1 
--format="%%P%%n%%an%%n%%ae%%n%%aD%%n%%cn%%n%%ce%%n%%cD%%n%%s%%n%%B" %s', 
escapeshellarg($revision));
+        $raw = explode("\n", trim($raw), 10); //10 elements separated by \n, 
last element - log message, first(skipped) element - "commit sha"
+        $data = [
+            'parents'           => $raw[1],  // %P
+            'author'            => $raw[2],  // %an
+            'author_email'      => $raw[3],  // %ae
+            'author_date'       => $raw[4],  // %aD
+            'committer'         => $raw[5],  // %cn
+            'committer_email'   => $raw[6],  // %ce
+            'committer_date'    => $raw[7],  // %cD
+            'subject'           => $raw[8],  // %s
+            'log'               => $raw[9]   // %B
+        ];
+        return $data;
     }
 
     /**


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to