From 46a9099bde2639d92720c740b681e1c889f3f373 Mon Sep 17 00:00:00 2001 From: Dronakurl Date: Thu, 2 Jan 2025 12:15:25 +0100 Subject: [PATCH] fix: create pr with upstream remote now works --- lua/octo/commands.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/octo/commands.lua b/lua/octo/commands.lua index 568bbd40..d1e6ee10 100644 --- a/lua/octo/commands.lua +++ b/lua/octo/commands.lua @@ -931,7 +931,12 @@ function M.create_pr(is_draft) end repo = remotes[remote_idx].repo else - repo = utils.get_remote_name() + -- Override the precedence of get_remote, because otherwise upstream is selected + -- and the check if the local branch creates on the repo fails. + repo = utils.get_remote_name { "origin" } + if not repo then + repo = utils.get_remote_name() + end if not repo then utils.error "Cant find repo name" return