[Fusionforge-commits] r9417 - trunk/gforge/plugins/scmgit/common

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 7 16:45:22 CEST 2010


Author: lolando
Date: 2010-04-07 16:45:22 +0200 (Wed, 07 Apr 2010)
New Revision: 9417

Modified:
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
Log:
Added missing logic to personal repositories (post-update hook)

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:45:11 UTC (rev 9416)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:45:22 UTC (rev 9417)
@@ -277,6 +277,18 @@
 			if (!is_file ("$repodir/HEAD") && !is_dir("$repodir/objects") && !is_dir("$repodir/refs")) {
 				system ("git clone --bare $main_repo $repodir") ;
 				system ("GIT_DIR=\"$repodir\" git update-server-info") ;
+				if (is_file ("$repodir/hooks/post-update.sample")) {
+					rename ("$repodir/hooks/post-update.sample",
+						"$repodir/hooks/post-update") ;
+				}
+				if (!is_file ("$repodir/hooks/post-update")) {
+					$f = fopen ("$repodir/hooks/post-update") ;
+					fwrite ($f, "exec git-update-server-info\n") ;
+					fclose ($f) ;
+				}
+				if (is_file ("$repodir/hooks/post-update")) {
+					system ("chmod +x $repodir/hooks/post-update") ;
+				}
 				system ("echo \"Git repository for user $owner in project $project_name\" > $repodir/description") ;
 				system ("chown -R $user_name:$unix_group $repodir") ;
 			}




More information about the Fusionforge-commits mailing list