File tree Expand file tree Collapse file tree 6 files changed +10
-7
lines changed
Expand file tree Collapse file tree 6 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ local log = require("neogit.lib.git.log")
66local config = require (" neogit.config" )
77
88local CherryPickPopup = require (" neogit.popups.cherry_pick" )
9+ local RevertPopup = require (" neogit.popups.revert" )
910
1011local api = vim .api
1112
@@ -129,6 +130,9 @@ function M:open()
129130 [" A" ] = function ()
130131 CherryPickPopup .create { commits = { self .commit_info .oid } }
131132 end ,
133+ [" _" ] = function ()
134+ RevertPopup .create { commits = { self .commit_info .oid } }
135+ end ,
132136 [" q" ] = function ()
133137 self :close ()
134138 end ,
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ function M:open()
8181 end ,
8282 [" _" ] = function ()
8383 local stack = self .buffer .ui :get_component_stack_under_cursor ()
84- RevertPopup .create ( stack [# stack ].options .oid )
84+ RevertPopup .create { commits = { stack [# stack ].options .oid } }
8585 end ,
8686 [" <enter>" ] = function ()
8787 local stack = self .buffer .ui :get_component_stack_under_cursor ()
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function M:open()
7777 end ,
7878 [" _" ] = function ()
7979 local stack = self .buffer .ui :get_component_stack_under_cursor ()
80- RevertPopup .create ( stack [# stack ].options .oid )
80+ RevertPopup .create { commits = { stack [# stack ].options .oid } }
8181 end ,
8282 [" <enter>" ] = function ()
8383 local stack = self .buffer .ui :get_component_stack_under_cursor ()
Original file line number Diff line number Diff line change 11local a = require (" plenary.async" )
2- local status = require (" neogit.status" )
32local git = require (" neogit.lib.git" )
43local CommitSelectViewBuffer = require (" neogit.buffers.commit_select_view" )
54
@@ -28,7 +27,7 @@ function M.commits(popup)
2827
2928 git .revert .commits (commits , popup :get_arguments ())
3029 a .util .scheduler ()
31- status .refresh (true , " revert_commits" )
30+ require ( " neogit. status" ) .refresh (true , " revert_commits" )
3231end
3332
3433return M
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ local popup = require("neogit.lib.popup")
33
44local M = {}
55
6- function M .create (commits )
6+ function M .create (env )
77 -- TODO: enabled = true needs to check if incompatible switch is toggled in internal state, and not apply.
88 -- if you enable 'no edit', and revert, next time you load the popup both will be enabled
99 --
@@ -19,7 +19,7 @@ function M.create(commits)
1919 :switch (" E" , " no-edit" , " Don't edit commit messages" , { incompatible = { " edit" } })
2020 :action (" _" , " Revert commit" , actions .commits ) -- TODO: Support multiple commits
2121 :action (" v" , " Revert changes" )
22- :env ({ commits = commits or {} })
22+ :env ({ commits = env . commits or {} })
2323 :build ()
2424
2525 p :show ()
Original file line number Diff line number Diff line change @@ -1131,7 +1131,7 @@ local cmd_func_map = function()
11311131 end ,
11321132 [" RevertPopup" ] = function ()
11331133 local line = M .status_buffer :get_current_line ()
1134- require (" neogit.popups.revert" ).create { line [1 ]:match (" ^(%x%x%x%x%x%x%x+)" ) }
1134+ require (" neogit.popups.revert" ).create { commits = { line [1 ]:match (" ^(%x%x%x%x%x%x%x+)" ) } }
11351135 end ,
11361136 [" BranchPopup" ] = require (" neogit.popups.branch" ).create ,
11371137 [" FetchPopup" ] = require (" neogit.popups.fetch" ).create ,
You can’t perform that action at this time.
0 commit comments