Don't delete hooks in .git/hooks

We currently delete all hooks in .git/hooks for each project before
symlink'ing in the standard project hooks.  This can be annoying for
users who have installed custom git hooks.

There's no reason to delete all existing hooks.  Just rip out the
deletion code.

Change-Id: I5062a6cd20af700f6d6a17b11ad6c94853987c57
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
Mitchel Humpherys 2015-01-15 22:40:02 -08:00
parent 3eb87cec5c
commit b9d9efd394

View File

@ -2121,15 +2121,6 @@ class Project(object):
def _UpdateHooks(self): def _UpdateHooks(self):
if os.path.exists(self.gitdir): if os.path.exists(self.gitdir):
# Always recreate hooks since they can have been changed
# since the latest update.
hooks = self._gitdir_path('hooks')
try:
to_rm = os.listdir(hooks)
except OSError:
to_rm = []
for old_hook in to_rm:
os.remove(os.path.join(hooks, old_hook))
self._InitHooks() self._InitHooks()
def _InitHooks(self): def _InitHooks(self):