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:
Diffstat (limited to 'cmd/gitaly-git2go/resolve_conflicts.go')
-rw-r--r--cmd/gitaly-git2go/resolve_conflicts.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmd/gitaly-git2go/resolve_conflicts.go b/cmd/gitaly-git2go/resolve_conflicts.go
index 73062eb17..6d05f59c7 100644
--- a/cmd/gitaly-git2go/resolve_conflicts.go
+++ b/cmd/gitaly-git2go/resolve_conflicts.go
@@ -180,26 +180,31 @@ func (cmd resolveSubcommand) Run(_ context.Context, decoder *gob.Decoder, encode
return fmt.Errorf("Missing resolutions for the following files: %s", strings.Join(conflictPaths, ", ")) //nolint
}
- tree, err := index.WriteTreeTo(repo)
+ treeOID, err := index.WriteTreeTo(repo)
if err != nil {
return fmt.Errorf("write tree to repo: %w", err)
}
+ tree, err := repo.LookupTree(treeOID)
+ if err != nil {
+ return fmt.Errorf("lookup tree: %w", err)
+ }
- signature := git2go.NewSignature(request.AuthorName, request.AuthorMail, request.AuthorDate)
+ sign := git2go.NewSignature(request.AuthorName, request.AuthorMail, request.AuthorDate)
committer := &git.Signature{
- Name: signature.Name,
- Email: signature.Email,
+ Name: sign.Name,
+ Email: sign.Email,
When: request.AuthorDate,
}
- commit, err := repo.CreateCommitFromIds("", committer, committer, request.Message, tree, ours.Id(), theirs.Id())
+ commitID, err := git2goutil.NewCommitSubmitter(repo, request.SigningKey).
+ Commit(committer, committer, git.MessageEncodingUTF8, request.Message, tree, ours, theirs)
if err != nil {
- return fmt.Errorf("could not create resolve conflict commit: %w", err)
+ return fmt.Errorf("create commit: %w", err)
}
response := git2go.ResolveResult{
MergeResult: git2go.MergeResult{
- CommitID: commit.String(),
+ CommitID: commitID.String(),
},
}