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

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Sep 3 16:10:10 CEST 2009


Author: lolando
Date: 2009-09-03 16:10:09 +0200 (Thu, 03 Sep 2009)
New Revision: 8078

Modified:
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
Log:
Make the repos work better for dumb transports (HTTP)

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2009-09-03 13:42:37 UTC (rev 8077)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2009-09-03 14:10:09 UTC (rev 8078)
@@ -169,6 +169,19 @@
 		system ("mkdir -p $repo") ;
 		if (!is_file ("$repo/HEAD") && !is_dir("$repo/objects") && !is_dir("$repo/refs")) {
 			system ("GIT_DIR=\"$repo\" git --bare init") ;
+			system ("GIT_DIR=\"$repo\" git update-server-info") ;
+			if (is_file ("$repo/hooks/post-update.sample")) {
+				rename ("$repo/hooks/post-update.sample",
+					"$repo/hooks/post-update") ;
+			}
+			if (!is_file ("$repo/hooks/post-update")) {
+				$f = fopen ("$repo/hooks/post-update") ;
+				fwrite ($f, "exec git-update-server-info\n") ;
+				fclose ($f) ;
+			}
+			if (is_file ("$repo/hooks/post-update")) {
+				system ("chmod +x $repo/hooks/post-update") ;
+			}
 			system ("echo \"Git repository for $project_name\" > $repo/description") ;
 		}
 




More information about the Fusionforge-commits mailing list