summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2014-01-09 02:11:09 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-09 02:11:10 +0000
commitbd80f7eedd5a74f6c5fad745091dcda53a6415bf (patch)
tree102f5d2113a84288ca86cbda42473af32f70b3e1
parentbf79c6618e4f51467e1d8e73915a541df660a060 (diff)
parent672cc499b9dce9c18ecd9dfc81fd18094535dc49 (diff)
downloadgit-repo-bd80f7eedd5a74f6c5fad745091dcda53a6415bf.tar.gz
Merge "Canonicalize project hooks path before use"
-rw-r--r--project.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/project.py b/project.py
index 0d491119..eb8bad3e 100644
--- a/project.py
+++ b/project.py
@@ -83,7 +83,7 @@ def _ProjectHooks():
83 """ 83 """
84 global _project_hook_list 84 global _project_hook_list
85 if _project_hook_list is None: 85 if _project_hook_list is None:
86 d = os.path.abspath(os.path.dirname(__file__)) 86 d = os.path.realpath(os.path.abspath(os.path.dirname(__file__)))
87 d = os.path.join(d , 'hooks') 87 d = os.path.join(d , 'hooks')
88 _project_hook_list = [os.path.join(d, x) for x in os.listdir(d)] 88 _project_hook_list = [os.path.join(d, x) for x in os.listdir(d)]
89 return _project_hook_list 89 return _project_hook_list
@@ -2016,7 +2016,7 @@ class Project(object):
2016 self._InitHooks() 2016 self._InitHooks()
2017 2017
2018 def _InitHooks(self): 2018 def _InitHooks(self):
2019 hooks = self._gitdir_path('hooks') 2019 hooks = os.path.realpath(self._gitdir_path('hooks'))
2020 if not os.path.exists(hooks): 2020 if not os.path.exists(hooks):
2021 os.makedirs(hooks) 2021 os.makedirs(hooks)
2022 for stock_hook in _ProjectHooks(): 2022 for stock_hook in _ProjectHooks():