import logging
import sys, os, re
+import subprocess
from gitosis import access
from gitosis import repository
from gitosis import gitdaemon
from gitosis import app
from gitosis import util
+from gitosis.repository import GitInitError
+
+from ConfigParser import NoSectionError, NoOptionError
log = logging.getLogger('gitosis.serve')
config=cfg,
)
+ try:
+ post_init_hook = cfg.get('hooks', 'post-init')
+ log.info ('Running post-init hook %s for new repository' % post_init_hook)
+ returncode = subprocess.call(
+ args=[ post_init_hook, repopath ],
+ stdout=sys.stderr
+ )
+ if returncode != 0:
+ raise GitInitError('exit status %d from post-init hook %s' % (returncode, post_init_hook))
+
+ except (NoSectionError, NoOptionError):
+ pass
+
# put the verb back together with the new path
newcmd = "%(verb)s '%(path)s'" % dict(
verb=verb,