Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2021-01-20 17:47:59 +0300
committerToon Claes <toon@gitlab.com>2021-02-17 18:12:20 +0300
commit0ff1d165de464430f09cd8b00cf54c9f71273980 (patch)
tree411caf7e7891f5e5610258001c34cf11d74aa2d5 /internal/git2go
parent8f979d5ed091a28419842ad62bb9137a73296c4e (diff)
Implement UserCherryPick in Go
This implements the `UserCherryPick` command in Go. It uses `gitaly-git2go` to call `func (*Repository) Cherrypick`. This feature is behind a feature flag and is disabled by default. The Ruby implementation is kept (for now) and is the default. The feature flag roll-out issue: https://gitlab.com/gitlab-org/gitaly/-/issues/3281 Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/3071
Diffstat (limited to 'internal/git2go')
-rw-r--r--internal/git2go/cherry_pick.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/git2go/cherry_pick.go b/internal/git2go/cherry_pick.go
new file mode 100644
index 000000000..71c7c6f06
--- /dev/null
+++ b/internal/git2go/cherry_pick.go
@@ -0,0 +1,33 @@
+package git2go
+
+import (
+ "context"
+ "time"
+
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
+)
+
+// CherryPickCommand contains parameters to perform a cherry pick.
+type CherryPickCommand struct {
+ // Repository is the path where to execute the cherry pick.
+ Repository string
+ // AuthorName is the author name for the resulting commit.
+ AuthorName string
+ // AuthorMail is the author mail for the resulting commit.
+ AuthorMail string
+ // AuthorDate is the author date of revert commit.
+ AuthorDate 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
+}
+
+// Run performs a cherry pick via gitaly-git2go.
+func (m CherryPickCommand) Run(ctx context.Context, cfg config.Cfg) (string, error) {
+ return runWithGob(ctx, cfg, "cherry-pick", m)
+}