diff options
author | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:13:33 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:19:51 +0100 |
commit | 4b9862e239deb939c87be2b02970a7bfe2996e13 (patch) | |
tree | 77e62821243ae73a12770d1f739e2e051475be04 /entity | |
parent | 3f6ef50883492f77995a7e27872d0b5ae17b9d6a (diff) | |
download | git-bug-4b9862e239deb939c87be2b02970a7bfe2996e13.tar.gz |
entity: make sure merge commit don't have operations
Diffstat (limited to 'entity')
-rw-r--r-- | entity/dag/entity.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/entity/dag/entity.go b/entity/dag/entity.go index 196280a8..c4368514 100644 --- a/entity/dag/entity.go +++ b/entity/dag/entity.go @@ -148,6 +148,10 @@ func read(def Definition, repo repository.ClockedRepo, resolver identity.Resolve return nil, err } + if isMerge && len(opp.Operations) > 0 { + return nil, fmt.Errorf("merge commit cannot have operations") + } + // Check that the create lamport clock is set (not checked in Validate() as it's optional) if isFirstCommit && opp.CreateTime <= 0 { return nil, fmt.Errorf("creation lamport time not set") |