From b9d9efd39413248196161765811b84f6b90cf07d Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Thu, 15 Jan 2015 22:40:02 -0800 Subject: [PATCH] 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 --- project.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/project.py b/project.py index cdce1e84..01ef3149 100644 --- a/project.py +++ b/project.py @@ -2121,15 +2121,6 @@ class Project(object): def _UpdateHooks(self): 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() def _InitHooks(self):