1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
package git2go
import (
"context"
"time"
"gitlab.com/gitlab-org/gitaly/v16/internal/git"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
)
// CherryPickCommand contains parameters to perform a cherry-pick.
type CherryPickCommand struct {
// Repository is the path where to execute the cherry-pick.
Repository string
// CommitterName is the committer name for the resulting commit.
CommitterName string
// CommitterMail is the committer mail for the resulting commit.
CommitterMail string
// CommitterDate is the committer date of revert commit.
CommitterDate time.Time
// Message is the message to be used for the resulting commit.
Message string
// Ours is the commit that the revert is applied to.
Ours string
// Commit is the commit that is to be picked.
Commit string
// Mainline is the parent to be considered the mainline
Mainline uint
// SigningKey is a path to the key to sign commit using OpenPGP
SigningKey string
}
// CherryPick performs a cherry-pick via gitaly-git2go.
func (b *Executor) CherryPick(ctx context.Context, repo storage.Repository, m CherryPickCommand) (git.ObjectID, error) {
m.SigningKey = b.signingKey
return b.runWithGob(ctx, repo, "cherry-pick", m)
}
|