mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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:
parent
3eb87cec5c
commit
b9d9efd394
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user