diff --git a/kallithea/lib/vcs/backends/git/repository.py b/kallithea/lib/vcs/backends/git/repository.py --- a/kallithea/lib/vcs/backends/git/repository.py +++ b/kallithea/lib/vcs/backends/git/repository.py @@ -321,15 +321,6 @@ class GitRepository(BaseRepository): url = ':///'.join(('file', url)) return url - def get_hook_location(self): - """ - returns absolute path to location where hooks are stored - """ - loc = os.path.join(self.path, 'hooks') - if not self.bare: - loc = os.path.join(self.path, '.git', 'hooks') - return loc - @LazyProperty def name(self): return os.path.basename(self.path) diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -492,12 +492,6 @@ class MercurialRepository(BaseRepository url = "file:" + urllib.pathname2url(url) return url - def get_hook_location(self): - """ - returns absolute path to location where hooks are stored - """ - return os.path.join(self.path, '.hg', '.hgrc') - def get_changeset(self, revision=None): """ Returns ``MercurialChangeset`` object representing repository's diff --git a/kallithea/tests/vcs/test_git.py b/kallithea/tests/vcs/test_git.py --- a/kallithea/tests/vcs/test_git.py +++ b/kallithea/tests/vcs/test_git.py @@ -780,9 +780,11 @@ class TestGitHooks(object): self.repo = GitRepository(self.repo_directory, create=True) # Create a dictionary where keys are hook names, and values are paths to - # them. Deduplicates code in tests a bit. - self.hook_directory = self.repo.get_hook_location() - self.kallithea_hooks = dict((h, os.path.join(self.hook_directory, h)) for h in ("pre-receive", "post-receive")) + # them in the non-bare repo. Deduplicates code in tests a bit. + self.kallithea_hooks = { + "pre-receive": os.path.join(self.repo.path, '.git', 'hooks', "pre-receive"), + "post-receive": os.path.join(self.repo.path, '.git', 'hooks', "post-receive"), + } def test_hooks_created_if_missing(self): """