Skip to content

Commit

Permalink
fix: replace get_config() with .values due to octo changing api
Browse files Browse the repository at this point in the history
Finally figured out the source of the problem. This commit 7b292e1 was pushed to account for GH Enterprise but Octo default settings leaves this blank. This fix accounts for that as well.

ref: petertriho#53
  • Loading branch information
GitMurf committed Dec 29, 2023
1 parent 88b4489 commit b966679
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lua/cmp_git/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ M.get_git_info = function(remotes, opts)
local host, owner, repo = nil, nil, nil

if vim.bo.filetype == "octo" then
host = require("octo.config").get_config().github_hostname
host = require("octo.config").values.github_hostname or ""
if host == "" then
host = "github.com"
end
local filename = vim.fn.expand("%:p:h")
owner, repo = string.match(filename, "^octo://(.+)/(.+)/.+$")
else
Expand Down Expand Up @@ -116,11 +119,6 @@ M.get_git_info = function(remotes, opts)
git_info = get_git_info()
end

if (git_info.host or "") == "" then
-- fallback to github.com
git_info.host = "github.com"
end

return git_info
end

Expand Down

0 comments on commit b966679

Please sign in to comment.