mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Support range selection for reverting commits
This commit is contained in:
parent
1c91999f61
commit
945b023eb5
6 changed files with 71 additions and 65 deletions
|
@ -285,14 +285,14 @@ func (self *CommitCommands) ShowFileContentCmdObj(hash string, filePath string)
|
|||
return self.cmd.New(cmdArgs).DontLog()
|
||||
}
|
||||
|
||||
// Revert reverts the selected commit by hash. If isMerge is true, we'll pass -m 1
|
||||
// Revert reverts the selected commits by hash. If isMerge is true, we'll pass -m 1
|
||||
// to say we want to revert the first parent of the merge commit, which is the one
|
||||
// people want in 99.9% of cases. In current git versions we could unconditionally
|
||||
// pass -m 1 even for non-merge commits, but older versions of git choke on it.
|
||||
func (self *CommitCommands) Revert(hash string, isMerge bool) error {
|
||||
func (self *CommitCommands) Revert(hashes []string, isMerge bool) error {
|
||||
cmdArgs := NewGitCmd("revert").
|
||||
Arg(hash).
|
||||
ArgIf(isMerge, "-m", "1").
|
||||
Arg(hashes...).
|
||||
ToArgv()
|
||||
|
||||
return self.cmd.New(cmdArgs).Run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue