Merge pull request #2467 from cmasone-attic/issue148

In merge.ThreeWay(), use Diff() across the board
This commit is contained in:
cmasone-attic
2016-08-30 13:48:50 -07:00
committed by GitHub
+4 -4
View File
@@ -112,10 +112,10 @@ func threeWayMerge(a, b, parent types.Value, vwr types.ValueReadWriter) (merged
func threeWayMapMerge(a, b, parent types.Map, vwr types.ValueReadWriter) (merged types.Value, err error) {
aDiff := func(change chan<- types.ValueChanged, stop <-chan struct{}) {
a.DiffLeftRight(parent, change, stop)
a.Diff(parent, change, stop)
}
bDiff := func(change chan<- types.ValueChanged, stop <-chan struct{}) {
b.DiffLeftRight(parent, change, stop)
b.Diff(parent, change, stop)
}
apply := func(target types.Value, change types.ValueChanged, newVal types.Value) types.Value {
switch change.ChangeType {
@@ -132,10 +132,10 @@ func threeWayMapMerge(a, b, parent types.Map, vwr types.ValueReadWriter) (merged
func threeWaySetMerge(a, b, parent types.Set, vwr types.ValueReadWriter) (merged types.Value, err error) {
aDiff := func(change chan<- types.ValueChanged, stop <-chan struct{}) {
a.DiffLeftRight(parent, change, stop)
a.Diff(parent, change, stop)
}
bDiff := func(change chan<- types.ValueChanged, stop <-chan struct{}) {
b.DiffLeftRight(parent, change, stop)
b.Diff(parent, change, stop)
}
getSelf := func(v types.Value) types.Value {
return v