| |
@@ -232,9 +232,7 @@
|
| |
)
|
| |
|
| |
|
| |
- def inform_pull_request_urls(
|
| |
- session, project, commits, refname, default_branch, username
|
| |
- ):
|
| |
+ def inform_pull_request_urls(session, project, commits, refname, username):
|
| |
"""Inform the user about the URLs to open a new pull-request or visit
|
| |
the existing one.
|
| |
"""
|
| |
@@ -242,6 +240,10 @@
|
| |
if project.is_fork:
|
| |
target_repo = project.parent
|
| |
|
| |
+ taget_repo_obj = pygit2.Repository(target_repo.repopath("main"))
|
| |
+ if not taget_repo_obj.is_empty and not taget_repo_obj.head_is_unborn:
|
| |
+ default_branch = taget_repo_obj.head.shorthand
|
| |
+
|
| |
pr_uids = []
|
| |
|
| |
if (
|
| |
Rather than assuming the default branch is the same in the source
and the target repo, we generate the new PR url using the default
branch of the target repo.
Fixes https://pagure.io/pagure/issue/5086
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr