Skip to content

Commit

Permalink
Merge branch 'feature/overlap-diff-and-merge' into feature/merge-as-g…
Browse files Browse the repository at this point in the history
…oroutine

# Conflicts:
#	catalog/cataloger_merge.go
After merge with overlap-diff-and-merge
  • Loading branch information
tzahij committed Nov 1, 2020
1 parent b9e4bab commit 511a054
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions catalog/cataloger_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ func (c *cataloger) Merge(ctx context.Context, repository, leftBranch, rightBran
return nil, err
}

mergeResult := &MergeResult{}
summary := make(map[DifferenceType]int)
mergeResult := &MergeResult{
Summary: make(map[DifferenceType]int),
}
_, err := c.db.Transact(func(tx db.Tx) (interface{}, error) {
leftID, err := getBranchID(tx, repository, leftBranch, LockTypeUpdate)
if err != nil {
Expand Down Expand Up @@ -74,7 +75,7 @@ func (c *cataloger) Merge(ctx context.Context, repository, leftBranch, rightBran
var rowsCounter int
for scanner.Next() {
v := scanner.Value()
summary[v.Type]++
mergeResult.Summary[v.Type]++
rowsCounter++
if v.Type == DifferenceTypeConflict {
return nil, ErrConflictFound
Expand Down Expand Up @@ -112,7 +113,6 @@ func (c *cataloger) Merge(ctx context.Context, repository, leftBranch, rightBran
if err != nil {
return nil, err
}
mergeResult.Summary = summary
mergeResult.Reference = MakeReference(rightBranch, nextCommitID)

for _, hook := range c.hooks.PostMerge {
Expand Down

0 comments on commit 511a054

Please sign in to comment.