Merge pull request #1339 from NeogitOrg/rebase-and-merge-interacrive

This commit is contained in:
Cameron 2024-05-28 23:17:24 +02:00 committed by GitHub
commit 3469de181d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 8 deletions

View file

@ -216,6 +216,12 @@ function M:open(kind, cwd)
["NeogitFetchComplete"] = function()
self:dispatch_refresh(nil, "fetch_complete")
end,
["NeogitRebase"] = function()
self:dispatch_refresh(nil, "rebase")
end,
["NeogitMerge"] = function()
self:dispatch_refresh(nil, "merge")
end,
},
}

View file

@ -8,8 +8,7 @@ local a = require("plenary.async")
local M = {}
local function merge_command(cmd)
local envs = client.get_envs_git_editor()
return cmd.env(envs).show_popup(true):in_pty(true).call { verbose = true }
return cmd.env(client.get_envs_git_editor()).call_interactive { verbose = true }
end
local function fire_merge_event(data)

View file

@ -6,15 +6,12 @@ local notification = require("neogit.lib.notification")
---@class NeogitGitRebase
local M = {}
local a = require("plenary.async")
local function fire_rebase_event(data)
vim.api.nvim_exec_autocmds("User", { pattern = "NeogitRebase", modeline = false, data = data })
end
local function rebase_command(cmd)
a.util.scheduler()
return cmd.env(client.get_envs_git_editor()).show_popup(true):in_pty(true).call { verbose = true }
return cmd.env(client.get_envs_git_editor()).call_interactive { verbose = true }
end
---Instant rebase. This is a way to rebase without using the interactive editor
@ -26,7 +23,7 @@ function M.instantly(commit, args)
.env({ GIT_SEQUENCE_EDITOR = ":" }).interactive.autostash.autosquash
.arg_list(args or {})
.commit(commit)
.call()
.call_interactive()
if result.code ~= 0 then
fire_rebase_event { commit = commit, status = "failed" }

View file

@ -170,10 +170,10 @@ function Repo.instance(dir)
local cwd = vim.fs.normalize(dir)
if not instances[cwd] then
logger.debug("[REPO]: Registered Repository for: " .. cwd)
instances[cwd] = Repo.new(cwd)
end
logger.debug("[REPO]: Loaded Repository for: " .. cwd)
return instances[cwd]
end