From 4b9862e239deb939c87be2b02970a7bfe2996e13 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 14 Feb 2021 12:13:33 +0100 Subject: entity: make sure merge commit don't have operations --- entity/dag/entity.go | 4 ++++ 1 file changed, 4 insertions(+) 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") -- cgit