File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -483,6 +483,15 @@ local configurations = {
483483 },
484484 },
485485
486+ [" rev-list" ] = config {
487+ flags = {
488+ parents = " --parents" ,
489+ },
490+ options = {
491+ max_count = " --max-count" ,
492+ },
493+ },
494+
486495 [" rev-parse" ] = config {
487496 flags = {
488497 verify = " --verify" ,
Original file line number Diff line number Diff line change @@ -69,7 +69,15 @@ function M.interactively(popup)
6969 end
7070
7171 if commit then
72- git .rebase .rebase_interactive (commit , popup :get_arguments ())
72+ local args = popup :get_arguments ()
73+ local parent_commit = git .cli [" rev-list" ].max_count (1 ).parents .args (commit ).call ().stdout [1 ]
74+ if commit ~= parent_commit then
75+ commit = vim .split (parent_commit , " " )[2 ]
76+ else
77+ table.insert (args , " --root" )
78+ end
79+
80+ git .rebase .rebase_interactive (commit , args )
7381 end
7482end
7583
You can’t perform that action at this time.
0 commit comments