Skip to content

Commit

Permalink
preventing graveler.go:Merge to merge a branch to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
tkalir committed Nov 29, 2024
1 parent 7f58e03 commit 5085291
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/graveler/graveler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5085291

Please sign in to comment.