diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py index 59ac0c4..ad4f568 100644 --- a/pagure/lib/tasks.py +++ b/pagure/lib/tasks.py @@ -299,16 +299,13 @@ def fork(name, namespace, user_owner, user_forker, editbranch, editfile): @conn.task -def pull_remote_repo(name, namespace, user, remote_git, branch_from, - branch_to): - session = pagure.lib.create_session() - +def pull_remote_repo(remote_git, branch_from): clonepath = pagure.get_remote_repo_path(remote_git, branch_from, ignore_non_exist=True) pygit2.clone_repository( remote_git, clonepath, checkout_branch=branch_from) - session.remove() + return clonepath @conn.task diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 9f3614c..def7cb2 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -1101,8 +1101,7 @@ def new_remote_request_pull(repo, username=None, namespace=None): repopath = pagure.get_remote_repo_path(remote_git, branch_from) if not repopath: taskid = pagure.lib.tasks.pull_remote_repo.delay( - repo.name, repo.namespace, repo.user.username, remote_git, - branch_from, branch_to) + remote_git, branch_from) return pagure.wait_for_task_post( taskid, form, 'new_remote_request_pull', repo=repo.name, username=username, namespace=namespace,