diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -2466,6 +2466,8 @@ class Project(object): | |||
2466 | os.makedirs(self.objdir) | 2466 | os.makedirs(self.objdir) |
2467 | self.bare_objdir.init() | 2467 | self.bare_objdir.init() |
2468 | 2468 | ||
2469 | self._UpdateHooks(quiet=quiet) | ||
2470 | |||
2469 | if self.use_git_worktrees: | 2471 | if self.use_git_worktrees: |
2470 | # Enable per-worktree config file support if possible. This is more a | 2472 | # Enable per-worktree config file support if possible. This is more a |
2471 | # nice-to-have feature for users rather than a hard requirement. | 2473 | # nice-to-have feature for users rather than a hard requirement. |
@@ -2526,8 +2528,6 @@ class Project(object): | |||
2526 | _lwrite(os.path.join(self.gitdir, 'objects/info/alternates'), | 2528 | _lwrite(os.path.join(self.gitdir, 'objects/info/alternates'), |
2527 | os.path.join(ref_dir, 'objects') + '\n') | 2529 | os.path.join(ref_dir, 'objects') + '\n') |
2528 | 2530 | ||
2529 | self._UpdateHooks(quiet=quiet) | ||
2530 | |||
2531 | m = self.manifest.manifestProject.config | 2531 | m = self.manifest.manifestProject.config |
2532 | for key in ['user.name', 'user.email']: | 2532 | for key in ['user.name', 'user.email']: |
2533 | if m.Has(key, include_defaults=False): | 2533 | if m.Has(key, include_defaults=False): |
@@ -2543,11 +2543,11 @@ class Project(object): | |||
2543 | raise | 2543 | raise |
2544 | 2544 | ||
2545 | def _UpdateHooks(self, quiet=False): | 2545 | def _UpdateHooks(self, quiet=False): |
2546 | if os.path.exists(self.gitdir): | 2546 | if os.path.exists(self.objdir): |
2547 | self._InitHooks(quiet=quiet) | 2547 | self._InitHooks(quiet=quiet) |
2548 | 2548 | ||
2549 | def _InitHooks(self, quiet=False): | 2549 | def _InitHooks(self, quiet=False): |
2550 | hooks = platform_utils.realpath(self._gitdir_path('hooks')) | 2550 | hooks = platform_utils.realpath(os.path.join(self.objdir, 'hooks')) |
2551 | if not os.path.exists(hooks): | 2551 | if not os.path.exists(hooks): |
2552 | os.makedirs(hooks) | 2552 | os.makedirs(hooks) |
2553 | for stock_hook in _ProjectHooks(): | 2553 | for stock_hook in _ProjectHooks(): |
@@ -2831,9 +2831,6 @@ class Project(object): | |||
2831 | 'for other options.') | 2831 | 'for other options.') |
2832 | return 'filesystem must support symlinks' | 2832 | return 'filesystem must support symlinks' |
2833 | 2833 | ||
2834 | def _gitdir_path(self, path): | ||
2835 | return platform_utils.realpath(os.path.join(self.gitdir, path)) | ||
2836 | |||
2837 | def _revlist(self, *args, **kw): | 2834 | def _revlist(self, *args, **kw): |
2838 | a = [] | 2835 | a = [] |
2839 | a.extend(args) | 2836 | a.extend(args) |