mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-23 07:16:21 +00:00
Merge "Canonicalize project hooks path before use"
This commit is contained in:
commit
bd80f7eedd
@ -83,7 +83,7 @@ def _ProjectHooks():
|
|||||||
"""
|
"""
|
||||||
global _project_hook_list
|
global _project_hook_list
|
||||||
if _project_hook_list is None:
|
if _project_hook_list is None:
|
||||||
d = os.path.abspath(os.path.dirname(__file__))
|
d = os.path.realpath(os.path.abspath(os.path.dirname(__file__)))
|
||||||
d = os.path.join(d , 'hooks')
|
d = os.path.join(d , 'hooks')
|
||||||
_project_hook_list = [os.path.join(d, x) for x in os.listdir(d)]
|
_project_hook_list = [os.path.join(d, x) for x in os.listdir(d)]
|
||||||
return _project_hook_list
|
return _project_hook_list
|
||||||
@ -2016,7 +2016,7 @@ class Project(object):
|
|||||||
self._InitHooks()
|
self._InitHooks()
|
||||||
|
|
||||||
def _InitHooks(self):
|
def _InitHooks(self):
|
||||||
hooks = self._gitdir_path('hooks')
|
hooks = os.path.realpath(self._gitdir_path('hooks'))
|
||||||
if not os.path.exists(hooks):
|
if not os.path.exists(hooks):
|
||||||
os.makedirs(hooks)
|
os.makedirs(hooks)
|
||||||
for stock_hook in _ProjectHooks():
|
for stock_hook in _ProjectHooks():
|
||||||
|
Loading…
Reference in New Issue
Block a user