Add ActionFlag field to Commit

Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
This commit is contained in:
Jesse Duffield 2026-01-28 09:29:45 +01:00 committed by Stefan Haller
parent 3bf833aea7
commit de98258e39
2 changed files with 9 additions and 4 deletions

View file

@ -325,6 +325,7 @@ func (self *CommitLoader) getHydratedTodoCommits(hashPool *utils.StringPool, tod
hydratedCommits = append(hydratedCommits, rebasingCommit)
} else if commit := findFullCommit(rebasingCommit.Hash()); commit != nil {
commit.Action = rebasingCommit.Action
commit.ActionFlag = rebasingCommit.ActionFlag
commit.Status = rebasingCommit.Status
hydratedCommits = append(hydratedCommits, commit)
}
@ -371,10 +372,11 @@ func (self *CommitLoader) getRebasingCommits(hashPool *utils.StringPool, addConf
continue
}
commits = utils.Prepend(commits, models.NewCommit(hashPool, models.NewCommitOpts{
Hash: t.Commit,
Name: t.Msg,
Status: models.StatusRebasing,
Action: t.Command,
Hash: t.Commit,
Name: t.Msg,
Status: models.StatusRebasing,
Action: t.Command,
ActionFlag: t.Flag,
}))
}

View file

@ -60,6 +60,7 @@ type Commit struct {
Status CommitStatus
Action todo.TodoCommand
ActionFlag string // e.g. "-C" for fixup -C
Divergence Divergence // set to DivergenceNone unless we are showing the divergence view
}
@ -68,6 +69,7 @@ type NewCommitOpts struct {
Name string
Status CommitStatus
Action todo.TodoCommand
ActionFlag string
Tags []string
ExtraInfo string
AuthorName string
@ -83,6 +85,7 @@ func NewCommit(hashPool *utils.StringPool, opts NewCommitOpts) *Commit {
Name: opts.Name,
Status: opts.Status,
Action: opts.Action,
ActionFlag: opts.ActionFlag,
Tags: opts.Tags,
ExtraInfo: opts.ExtraInfo,
AuthorName: opts.AuthorName,