From d86c69c137c76e29c2ff846cc33ec7b972935d8d Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Apr 28 2016 18:39:17 +0000 Subject: Fixed post-receive pre-receive hook name --- diff --git a/pagure/hooks/__init__.py b/pagure/hooks/__init__.py index 55059c3..ed2e2a2 100644 --- a/pagure/hooks/__init__.py +++ b/pagure/hooks/__init__.py @@ -97,7 +97,12 @@ class BaseHook(object): os.makedirs(hookfolder) # Install the hook itself - hook_file = os.path.join(repopath, 'hooks', 'post-receive.' + hook_name) + if hook_name in ['pagureforcecommit', 'pagureunsignedcommit']: + hook_file = os.path.join(repopath, 'hooks', 'pre-receive.' + + hook_name) + else: + hook_file = os.path.join(repopath, 'hooks', 'post-receive.' + + hook_name) if not os.path.exists(hook_file): os.symlink( @@ -114,6 +119,11 @@ class BaseHook(object): ''' for repopath in repopaths: - hook_path = os.path.join(repopath, 'hooks', 'post-receive.' + hook_name) + if hook_name in ['pagureforcecommit', 'pagureunsignedcommit']: + hook_path = os.path.join(repopath, 'hooks', 'pre-receive.' + + hook_name) + else: + hook_path = os.path.join(repopath, 'hooks', 'post-receive.' + + hook_name) if os.path.exists(hook_path): os.unlink(hook_path)