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 'internal/git2go/merge.go')
-rw-r--r--internal/git2go/merge.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/git2go/merge.go b/internal/git2go/merge.go
index b03b3e499..17e9a4fe2 100644
--- a/internal/git2go/merge.go
+++ b/internal/git2go/merge.go
@@ -25,6 +25,15 @@ type MergeCommand struct {
AuthorMail string
// AuthorDate is the author date of merge commit.
AuthorDate time.Time
+ // CommitterName. Can be empty if all Committer* vars are empty.
+ // In that case AuthorName is used instead.
+ CommitterName string
+ // CommitterMail. Can be empty if all Committer* vars are empty.
+ // In that case AuthorMail is used instead.
+ CommitterMail string
+ // CommitterDate. Can be empty if all Committer* vars are empty.
+ // In that case AuthorDate is used instead.
+ CommitterDate time.Time
// Message is the message to be used for the merge commit.
Message string
// Ours is the commit into which theirs is to be merged.
@@ -77,5 +86,17 @@ func (m MergeCommand) verify() error {
if m.Theirs == "" {
return errors.New("missing theirs")
}
+ // If at least one Committer* var is set, require all of them to be set.
+ if m.CommitterMail != "" || !m.CommitterDate.IsZero() || m.CommitterName != "" {
+ if m.CommitterMail == "" {
+ return errors.New("missing committer mail")
+ }
+ if m.CommitterName == "" {
+ return errors.New("missing committer name")
+ }
+ if m.CommitterDate.IsZero() {
+ return errors.New("missing committer date")
+ }
+ }
return nil
}