Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Jan 4, 2025
1 parent d7c1be3 commit 52c3f20
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions go/cmd/dolt/commands/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,13 +1675,21 @@ func writeDiffResults(
for i, changeType := range newRow.ColDiffs {
if (changeType == diff.Added|diff.Removed) || modifiedColNames[targetSch[i].Name] {
if oldRow.Row != nil && i < oldRow.Row.Len() {
filteredOldRow.Row = filteredOldRow.Row.Append(oldRow.Row.Subslice(i, i+1))
if filteredOldRow.Row == nil {
filteredOldRow.Row = oldRow.Row.Subslice(i, i+1)
} else {
filteredOldRow.Row = filteredOldRow.Row.Append(oldRow.Row.Subslice(i, i+1))
}
filteredOldRow.ColDiffs = append(filteredOldRow.ColDiffs, oldRow.ColDiffs[i])
filteredOldRow.RowDiff = oldRow.RowDiff
}

if newRow.Row != nil && i < newRow.Row.Len() {
filteredNewRow.Row = filteredNewRow.Row.Append(newRow.Row.Subslice(i, i+1))
if filteredNewRow.Row == nil {
filteredNewRow.Row = newRow.Row.Subslice(i, i+1)
} else {
filteredNewRow.Row = filteredNewRow.Row.Append(newRow.Row.Subslice(i, i+1))
}
filteredNewRow.ColDiffs = append(filteredNewRow.ColDiffs, newRow.ColDiffs[i])
filteredNewRow.RowDiff = newRow.RowDiff
}
Expand Down

0 comments on commit 52c3f20

Please sign in to comment.