diff --git a/pagure/hooks/files/hookrunner b/pagure/hooks/files/hookrunner index 3736470..4edf6a2 100755 --- a/pagure/hooks/files/hookrunner +++ b/pagure/hooks/files/hookrunner @@ -14,6 +14,12 @@ import sys # as a python module (for example if you run it from a git clone). #sys.path.insert(0, '/path/to/pagure/') +if os.environ.get("internal_no_hooks", False): + # we do this check before any pagure machinery is imported + # and initialized to make sure this is very fast (used + # when pushing code from original repos to forks) + sys.exit(0) + if "PAGURE_CONFIG" not in os.environ and os.path.exists( "/etc/pagure/pagure.cfg" ): diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py index eb44613..a3deb4e 100644 --- a/pagure/lib/tasks.py +++ b/pagure/lib/tasks.py @@ -488,7 +488,7 @@ def fork( "pagure", "remotes/%s" % branchname, "refs/heads/%s" % localname, - internal="yes", + internal_no_hooks="yes", ) if not repo_to.is_on_repospanner and not repo_to.private: