mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-16 14:24:09 +02:00
Merge pull request #1339 from NeogitOrg/rebase-and-merge-interacrive
This commit is contained in:
commit
3469de181d
4 changed files with 10 additions and 8 deletions
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue