From 1d4c5fcf43a0f9bcbbf99ca79dd73bc84158d442 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 27 2015 17:31:58 +0000 Subject: Adjust how we find the repo paths for regular and remote PR when generating a patch --- diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 1e3a937..bbaed0c 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -277,11 +277,16 @@ def request_pull_patch(repo, requestid, username=None): if not request: flask.abort(404, 'Pull-request not found') - repo_from = request.project_from - repopath = pagure.get_repo_path(repo_from) - repo_obj = pygit2.Repository(repopath) + if request.remote: + repopath = pagure.get_remote_repo_path( + request.remote_git, request.branch_from) + parentpath = pagure.get_repo_path(request.project) + else: + repo_from = request.project_from + repopath = pagure.get_repo_path(repo_from) + parentpath = _get_parent_repo_path(repo_from) - parentpath = _get_parent_repo_path(repo_from) + repo_obj = pygit2.Repository(repopath) orig_repo = pygit2.Repository(parentpath) branch = repo_obj.lookup_branch(request.branch_from)