diff options
author | John Cai <jcai@gitlab.com> | 2023-08-17 17:45:43 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2023-08-17 17:45:43 +0300 |
commit | e26745f41023d72cad0676db39579d0aa45b4bcb (patch) | |
tree | a41bb5ededb9d141bd7f5eb5069a115796f8c293 /internal/git2go | |
parent | f56c2ec1f34f6e9a41c21069fa9bfbae54190ba7 (diff) |
Revert "Merge branch 'jc/remove-cherry-pick-ff' into 'master'"
This reverts commit acfe013b5e5e7c3992a889058a73ec8f7f1b4de7, reversing
changes made to 023c2a7d02fa92926cb3db390357149e5ac1151c.
Diffstat (limited to 'internal/git2go')
-rw-r--r-- | internal/git2go/cherry_pick.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/internal/git2go/cherry_pick.go b/internal/git2go/cherry_pick.go new file mode 100644 index 000000000..435d85cbf --- /dev/null +++ b/internal/git2go/cherry_pick.go @@ -0,0 +1,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) +} |