From 5085291799a842e797a7e53f186d4b86ec2e0bd2 Mon Sep 17 00:00:00 2001 From: Tamar Date: Fri, 29 Nov 2024 01:29:51 +0200 Subject: [PATCH] preventing graveler.go:Merge to merge a branch to itself --- pkg/graveler/graveler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index fdf25e8bea7..b0961f258b6 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -2897,6 +2897,9 @@ func (g *Graveler) Merge(ctx context.Context, repository *RepositoryRecord, dest if err != nil { return nil, err } + if fromCommit.CommitID == toCommit.CommitID { + return nil, ErrSameBranch + } lg.WithFields(logging.Fields{ "source_meta_range": fromCommit.MetaRangeID, "destination_meta_range": toCommit.MetaRangeID,