blob: 9cd4ec814f4a60c06b4de2c413d167aec7837b0a (
plain)
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"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/repository"
)
// RebaseCommand contains parameters to rebase a branch.
type RebaseCommand struct {
// Repository is the path to execute rebase in.
Repository string
// Committer contains the the committer signature.
Committer Signature
// BranchName is the branch that is rebased. Deprecated, can be removed in the next release.
BranchName string
// UpstreamRevision is the revision where the branch is rebased onto. Deprecated, can be
// removed in the next release.
UpstreamRevision string
// CommitID is the object ID of the commit that shall be rebased. Deprecates BranchName.
CommitID git.ObjectID
// UpstreamCommitID is the object ID of the commit which is considered to be the
// upstream branch. This parameter determines both the commit onto which we're
// about to rebase, which is the merge base of the upstream commit and rebased
// commit, and which commits should be rebased, which is the commit range
// upstream..commit. Deprecates the UpstreamRevision.
UpstreamCommitID git.ObjectID
// SkipEmptyCommits will cause commits which have already been applied on the target branch
// and which are thus empty to be skipped. If unset, empty commits will cause the rebase to
// fail.
SkipEmptyCommits bool
}
// Rebase performs the rebase via gitaly-git2go
func (b *Executor) Rebase(ctx context.Context, repo repository.GitRepo, r RebaseCommand) (git.ObjectID, error) {
return b.runWithGob(ctx, repo, "rebase", r)
}
|