From 98e262acb851e3dec895cea14f399d5415505204 Mon Sep 17 00:00:00 2001 From: Drew Daniels Date: Sat, 12 Oct 2024 11:11:45 -0500 Subject: [PATCH] squash --- lua/octo/navigation.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/octo/navigation.lua b/lua/octo/navigation.lua index 23e7fa19..3e2ba3dd 100644 --- a/lua/octo/navigation.lua +++ b/lua/octo/navigation.lua @@ -33,7 +33,13 @@ function M.open_in_browser(kind, repo, number) local bufnr = vim.api.nvim_get_current_buf() local buffer = octo_buffers[bufnr] if not buffer then - return + local owner_repo = utils.get_remote_name() + if not owner_repo then + utils.error "No remote repository found" + return + end + cmd = string.format("gh repo view --web %s", owner_repo) + return pcall(vim.cmd, "silent !" .. cmd) end if buffer:isPullRequest() then cmd = string.format("gh pr view --web -R %s/%s %d", remote, buffer.repo, buffer.number)