Skip to content

Commit

Permalink
Fix unpushed section
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Aug 8, 2023
1 parent b8f5459 commit e74f522
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/neogit/lib/git/push.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ function M.push_interactive(remote, branch, args)
end

local function update_unmerged(state)
local upstream_unmerged = {}
local pushRemote_unmerged = {}

if state.upstream.ref then
state.upstream.unmerged = { items = {} }
state.upstream.unmerged.items = util.filter_map(log.list { "@{upstream}.." }, function(v)
upstream_unmerged = util.filter_map(log.list { "@{upstream}.." }, function(v)
if v.oid then
return {
name = string.format("%s %s", v.oid:sub(1, 7), v.description[1] or "<empty>"),
Expand All @@ -29,8 +31,7 @@ local function update_unmerged(state)

local pushRemote = require("neogit.lib.git").branch.pushRemote_ref()
if pushRemote then
state.pushRemote.unmerged = { items = {} }
state.pushRemote.unmerged.items = util.filter_map(log.list { pushRemote .. ".." }, function(v)
pushRemote_unmerged = util.filter_map(log.list { pushRemote .. ".." }, function(v)
if v.oid then
return {
name = string.format("%s %s", v.oid:sub(1, 7), v.description[1] or "<empty>"),
Expand All @@ -40,6 +41,9 @@ local function update_unmerged(state)
end
end)
end

state.upstream.unmerged.items = upstream_unmerged
state.pushRemote.unmerged.items = pushRemote_unmerged
end

function M.register(meta)
Expand Down

0 comments on commit e74f522

Please sign in to comment.