feat: new 'actions.git_reset': discard local changes

main
bhagwan 2 years ago
parent a0ac8021de
commit 5fbbc3b653

@ -498,6 +498,11 @@ M.git_unstage = function(selected, opts)
git_exec(selected, opts, cmd)
end
M.git_reset = function(selected, opts)
local cmd = path.git_cwd({"git", "checkout", "HEAD", "--"}, opts)
git_exec(selected, opts, cmd)
end
M.git_buf_edit = function(selected, opts)
local cmd = path.git_cwd({"git", "show"}, opts)
local git_root = path.git_root(opts, true)

@ -866,6 +866,7 @@ M._action_to_helpstr = {
[actions.git_checkout] = "git-checkout",
[actions.git_stage] = "git-stage",
[actions.git_unstage] = "git-unstage",
[actions.git_reset] = "git-reset",
[actions.git_buf_edit] = "git-buffer-edit",
[actions.git_buf_tabedit] = "git-buffer-tabedit",
[actions.git_buf_split] = "git-buffer-split",

Loading…
Cancel
Save