This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  c0ce0b87b1281a310bb933e06b557699c8cc7292 (commit)
      from  cdc283e54d1ac50e07f780584d5bbdba33732961 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=c0ce0b87b1281a310bb933e06b557699c8cc7292

commit c0ce0b87b1281a310bb933e06b557699c8cc7292
Author: Franck Villaume <[email protected]>
Date:   Fri Sep 8 13:11:12 2017 +0000

    less code

diff --git a/src/plugins/scmgit/common/GitPlugin.class.php 
b/src/plugins/scmgit/common/GitPlugin.class.php
index aaf3f17..888e3fe 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -94,16 +94,8 @@ control over it to the project's administrator.");
        }
 
        function getInstructionsForAnon($project) {
-               $repo_list = array($project->getUnixName());
+               $repo_list = $this->getRepositories($project);
                $protocol = forge_get_config('use_ssl', 'scmgit')? 'https' : 
'http';
-               $result = db_query_params('SELECT repo_name FROM 
scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3 
ORDER BY repo_name',
-                                          array($project->getID(),
-                                                 SCM_EXTRA_REPO_ACTION_UPDATE,
-                                                 $this->getID()));
-               $rows = db_numrows($result);
-               for ($i=0; $i<$rows; $i++) {
-                       $repo_list[] = db_result($result,$i,'repo_name');
-               }
                $clone_commands = array();
                foreach ($repo_list as $repo_name) {
                        if (forge_get_config('use_smarthttp', 'scmgit')) {
@@ -156,16 +148,7 @@ control over it to the project's administrator.");
 
        function getInstructionsForRW($project) {
                global $HTML;
-               $repo_list = array($project->getUnixName());
-
-               $result = db_query_params('SELECT repo_name FROM 
scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3 
ORDER BY repo_name',
-                                          array($project->getID(),
-                                                 SCM_EXTRA_REPO_ACTION_UPDATE,
-                                                 $this->getID()));
-               $rows = db_numrows($result);
-               for ($i=0; $i<$rows; $i++) {
-                       $repo_list[] = db_result($result, $i, 'repo_name');
-               }
+               $repo_list = $this->getRepositories($project);
 
                $b = '';
                $b .= html_e('h2', array(), _('Developer Access'));
@@ -698,14 +681,9 @@ control over it to the project's administrator.");
                        $start_time = gmmktime(0, 0, 0, $month, $day, $year);
                        $end_time = $start_time + 86400;
 
-                       $this->gatherStatsRepo($project, 
$project->getUnixName(), $year, $month, $day);
-
-                       $result = db_query_params('SELECT repo_name FROM 
scm_secondary_repos WHERE group_id = $1 AND plugin_id = $2 ORDER BY repo_name',
-                                                  array($project->getID(),
-                                                         $this->getID()));
-                       $rows = db_numrows($result);
-                       for ($i=0; $i<$rows; $i++) {
-                               $this->gatherStatsRepo($project, 
db_result($result, $i, 'repo_name'), $year, $month, $day);
+                       $repolist = $this->getRepositories($project);
+                       foreach ($repolist as $repo_name) {
+                               $this->gatherStatsRepo($project, $repo_name, 
$year, $month, $day);
                        }
                }
        }
@@ -1517,6 +1495,18 @@ control over it to the project's administrator.");
                        }
                }
        }
+
+       function getRepositories($group) {
+               $repoarr = array($group->getUnixName());
+               $result = db_query_params('SELECT repo_name FROM 
scm_secondary_repos WHERE group_id = $1 AND next_action = $2 AND plugin_id = $3 
ORDER BY repo_name',
+                                                  array($group->getID(),
+                                                         
SCM_EXTRA_REPO_ACTION_UPDATE,
+                                                         $this->getID()));
+               while ($arr = db_fetch_array($result)) {
+                       $repoarr[] = $arr['repo_name'];
+               }
+               return $repoarr;
+       }
 }
 
 // Local Variables:

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/scmgit/common/GitPlugin.class.php | 44 +++++++++++----------------
 1 file changed, 17 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to