Commit 5c20ff89 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6270a51d
......@@ -394,17 +394,18 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
*/
var aT, bT *Tree
var aB, bB *Bucket
isT := false
if a != nil {
aT, _ = a.(*Tree)
aB, _ = a.(*Bucket)
aT, isT = a.(*Tree)
aB, _ = a.(*Bucket)
if (aT == nil && aB == nil) {
panicf("a: bad type %T", a)
}
}
if b != nil {
bT, _ = b.(*Tree)
bB, _ = b.(*Bucket)
bT, isT = b.(*Tree)
bB, _ = b.(*Bucket)
if (bT == nil && bB == nil) {
panicf("b: bad type %T", b)
}
......@@ -420,8 +421,11 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
}
}
panic("TODO")
if isT {
return diffT(ctx, aT, bT, δZTC)
} else {
return diffB(ctx, aB, bB)
}
}
// diffT computes difference in between two revisions of a tree's subtree.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment