From 573708186c089f1a9f76c05286cd16592a5124b2 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 16 2016 09:00:02 +0000 Subject: The no-FF git hook is only applicable to the main git repo --- diff --git a/pagure/hooks/pagure_force_commit.py b/pagure/hooks/pagure_force_commit.py index 09b8930..4715653 100644 --- a/pagure/hooks/pagure_force_commit.py +++ b/pagure/hooks/pagure_force_commit.py @@ -83,27 +83,20 @@ class PagureForceCommitHook(BaseHook): should be installed ''' - repopaths = [get_repo_path(project)] - for folder in [ - APP.config.get('DOCS_FOLDER'), - APP.config.get('REQUESTS_FOLDER')]: - repopaths.append( - os.path.join(folder, project.path) - ) + repopath = get_repo_path(project) hook_files = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'files') hook_file = os.path.join(hook_files, 'pagure_force_commit_hook.py') - for repopath in repopaths: - # Init the git repo in case - pygit2.Repository(repopath) + # Init the git repo in case + pygit2.Repository(repopath) - # Install the hook itself - hook_path = os.path.join( - repopath, 'hooks', 'pre-receive.pagureforcecommit') - if not os.path.exists(hook_path): - os.symlink(hook_file, hook_path) + # Install the hook itself + hook_path = os.path.join( + repopath, 'hooks', 'pre-receive.pagureforcecommit') + if not os.path.exists(hook_path): + os.symlink(hook_file, hook_path) @classmethod def remove(cls, project):