Skip to content

Commit

Permalink
Print missing access message appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
qwrtln committed Aug 27, 2024
1 parent 78121b5 commit b625bce
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lua/neogit/popups/push/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,17 @@ local function push_to(args, remote, branch, opts)
else
logger.error("Failed to push to " .. name)

local stderr = table.concat(res.stderr)
if string.find(stderr, "Permission denied (publickey)") then
notification.info(
"Permission denied (publickey). Please make sure you have the correct access rights and the repository exists."
)
return
local stdout = table.concat(res.stdout)

if string.find(stdout, "Permission denied %(publickey%)") then
notification.info(table.concat(res.stdout, "\n"))
end

-- Only ask the user whether to force push if not already specified
if vim.tbl_contains(args, "--force") or vim.tbl_contains(args, "--force-with-lease") then
return
end

local stdout = table.concat(res.stdout)
if string.find(stdout, "Updates were rejected") == nil then
return
end
Expand Down

0 comments on commit b625bce

Please sign in to comment.