From e6bff32139f600ae7c45633b38703bb43477790f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 24 2016 09:13:24 +0000 Subject: Do not try to run the post-receive hook is none are installed --- diff --git a/pagure/lib/repo.py b/pagure/lib/repo.py index 6496b4e..1b77330 100644 --- a/pagure/lib/repo.py +++ b/pagure/lib/repo.py @@ -87,6 +87,10 @@ class PagureRepo(pygit2.Repository): env['GIT_DIR'] = self.path env['GL_USER'] = username + hookfile = os.path.join(self.path, 'hooks', 'post-receive') + if not os.path.exists(hookfile): + return + procs = subprocess.Popen( cmd, stdin=subprocess.PIPE,