diff --git a/project.py b/project.py
index c6a91d0..028deb5 100644
--- a/project.py
+++ b/project.py
@@ -69,6 +69,27 @@
 def sq(r):
   return "'" + r.replace("'", "'\''") + "'"
 
+_project_hook_list = None
+def _ProjectHooks():
+  """List the hooks present in the 'hooks' directory.
+
+  These hooks are project hooks and are copied to the '.git/hooks' directory
+  of all subprojects.
+
+  This function caches the list of hooks (based on the contents of the
+  'repo/hooks' directory) on the first call.
+
+  Returns:
+    A list of absolute paths to all of the files in the hooks directory.
+  """
+  global _project_hook_list
+  if _project_hook_list is None:
+    d = os.path.realpath(os.path.abspath(os.path.dirname(__file__)))
+    d = os.path.join(d, 'hooks')
+    _project_hook_list = [os.path.join(d, x) for x in os.listdir(d)]
+  return _project_hook_list
+
+
 class DownloadedChange(object):
   _commit_cache = None
 
@@ -2085,7 +2106,7 @@
     if GitCommand(self, cmd).Wait() != 0:
       raise GitError('%s merge %s ' % (self.name, head))
 
-  def _InitGitDir(self, mirror_git=None, MirrorOverride=False):
+  def _InitGitDir(self, mirror_git=None):
     if not os.path.exists(self.gitdir):
 
       # Initialize the bare repository, which contains all of the objects.
@@ -2127,38 +2148,11 @@
       for key in ['user.name', 'user.email']:
         if m.Has(key, include_defaults=False):
           self.config.SetString(key, m.GetString(key))
-      if self.manifest.IsMirror and not MirrorOverride:
+      if self.manifest.IsMirror:
         self.config.SetString('core.bare', 'true')
       else:
         self.config.SetString('core.bare', None)
 
-  def _ProjectHooks(self, remote, repodir):
-    """List the hooks present in the 'hooks' directory.
-
-    These hooks are project hooks and are copied to the '.git/hooks' directory
-    of all subprojects.
-
-    The remote projecthooks supplement/overrule any stockhook making it possible to
-    have a combination of hooks both from the remote projecthook and
-    .repo/hooks directories.
-
-    Returns:
-      A list of absolute paths to all of the files in the hooks directory and
-      projecthooks files, excluding the .git folder.
-    """
-    hooks = {}
-    d = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'hooks')
-    hooks = dict([(x, os.path.join(d, x)) for x in os.listdir(d)])
-    if remote is not None:
-      if remote.projecthookName is not None:
-        d = os.path.abspath('%s/projecthooks/%s/%s' % (repodir, remote.name, remote.projecthookName))
-        if os.path.isdir(d):
-          hooks.update(dict([(x, os.path.join(d, x)) for x in os.listdir(d)]))
-
-    if hooks.has_key('.git'):
-      del hooks['.git']
-    return hooks.values()
-
   def _UpdateHooks(self):
     if os.path.exists(self.gitdir):
       self._InitHooks()
@@ -2167,10 +2161,7 @@
     hooks = os.path.realpath(self._gitdir_path('hooks'))
     if not os.path.exists(hooks):
       os.makedirs(hooks)
-    pr = None
-    if self is not self.manifest.manifestProject:
-      pr = self.manifest.remotes.get(self.remote.name)
-    for stock_hook in self._ProjectHooks(pr, self.manifest.repodir):
+    for stock_hook in _ProjectHooks():
       name = os.path.basename(stock_hook)
 
       if name in ('commit-msg',) and not self.remote.review \
