mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-25 18:55:28 -06:00
Add a "Mark commit as base commit for rebase" command
This allows to do the equivalent of "git rebase --onto <target> <base>", by first marking the <base> commit with the new command, and then selecting the target branch and invoking the usual rebase command there.
This commit is contained in:
25
pkg/gui/modes/marked_base_commit/marked_base_commit.go
Normal file
25
pkg/gui/modes/marked_base_commit/marked_base_commit.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package marked_base_commit
|
||||
|
||||
type MarkedBaseCommit struct {
|
||||
sha string // the sha of the commit used as a rebase base commit; empty string when unset
|
||||
}
|
||||
|
||||
func New() MarkedBaseCommit {
|
||||
return MarkedBaseCommit{}
|
||||
}
|
||||
|
||||
func (m *MarkedBaseCommit) Active() bool {
|
||||
return m.sha != ""
|
||||
}
|
||||
|
||||
func (m *MarkedBaseCommit) Reset() {
|
||||
m.sha = ""
|
||||
}
|
||||
|
||||
func (m *MarkedBaseCommit) SetSha(sha string) {
|
||||
m.sha = sha
|
||||
}
|
||||
|
||||
func (m *MarkedBaseCommit) GetSha() string {
|
||||
return m.sha
|
||||
}
|
||||
Reference in New Issue
Block a user