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 ...@@ -394,17 +394,18 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
*/ */
var aT, bT *Tree var aT, bT *Tree
var aB, bB *Bucket var aB, bB *Bucket
isT := false
if a != nil { if a != nil {
aT, _ = a.(*Tree) aT, isT = a.(*Tree)
aB, _ = a.(*Bucket) aB, _ = a.(*Bucket)
if (aT == nil && aB == nil) { if (aT == nil && aB == nil) {
panicf("a: bad type %T", a) panicf("a: bad type %T", a)
} }
} }
if b != nil { if b != nil {
bT, _ = b.(*Tree) bT, isT = b.(*Tree)
bB, _ = b.(*Bucket) bB, _ = b.(*Bucket)
if (bT == nil && bB == nil) { if (bT == nil && bB == nil) {
panicf("b: bad type %T", b) panicf("b: bad type %T", b)
} }
...@@ -420,8 +421,11 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err ...@@ -420,8 +421,11 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid) (δ map[Key]Value, err
} }
} }
if isT {
panic("TODO") return diffT(ctx, aT, bT, δZTC)
} else {
return diffB(ctx, aB, bB)
}
} }
// diffT computes difference in between two revisions of a tree's subtree. // 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