mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Don't flip out if there are no template hooks
Git may have been installed without its hooks directory, which means we won't have any hooks in a repo created git repository. Since we are just deleting the hooks it doesn't matter. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
bd4edc9a69
commit
de646819b8
@ -775,7 +775,11 @@ class Project(object):
|
||||
self.config.SetString('core.bare', None)
|
||||
|
||||
hooks = self._gitdir_path('hooks')
|
||||
for old_hook in os.listdir(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))
|
||||
|
||||
# TODO(sop) install custom repo hooks
|
||||
|
Loading…
Reference in New Issue
Block a user