Skip to content

Commit

Permalink
Use remotes.pushDefault value if set
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Jul 13, 2023
1 parent 75467a8 commit d5f2a96
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/neogit/popups/branch_config/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ local FuzzyFinderBuffer = require("neogit.buffers.fuzzy_finder")
local M = {}

function M.remotes_for_config()
local remotes = {
{ display = "", value = "" },
}

local remotes = {}
for _, name in ipairs(git.remote.list()) do
table.insert(remotes, { display = name, value = name })
end

local pushDefault = git.config.get("remote.pushDefault")
if pushDefault:is_set() then
table.insert(remotes, { display = "remote.pushDefault:" .. pushDefault.value, value = "" })
else
table.insert(remotes, { display = "", value = "" })
end

return remotes
end

Expand Down

0 comments on commit d5f2a96

Please sign in to comment.