feat: new action 'git_stash_pop' (#410)

main
bhagwan 2 years ago
parent 23034bb022
commit de7ac64e74

@ -508,6 +508,14 @@ M.git_stash_drop = function(selected, opts)
git_exec(selected, opts, cmd)
end
M.git_stash_pop = function(selected, opts)
if vim.fn.input("Pop " .. #selected .. " stash(es)? [y/n] ") == "y" then
local cmd = path.git_cwd({"git", "stash", "pop"}, opts)
git_exec(selected, opts, cmd)
vim.cmd("e!")
end
end
M.git_stash_apply = function(selected, opts)
if vim.fn.input("Apply " .. #selected .. " stash(es)? [y/n] ") == "y" then
local cmd = path.git_cwd({"git", "stash", "apply"}, opts)

@ -883,6 +883,7 @@ M._action_to_helpstr = {
[actions.git_stage] = "git-stage",
[actions.git_unstage] = "git-unstage",
[actions.git_reset] = "git-reset",
[actions.git_stash_pop] = "git-stash-pop",
[actions.git_stash_drop] = "git-stash-drop",
[actions.git_stash_apply] = "git-stash-apply",
[actions.git_buf_edit] = "git-buffer-edit",

Loading…
Cancel
Save