Raw loader and key fixes

This commit is contained in:
mcrakhman 2022-10-20 20:12:00 +02:00 committed by Mikhail Iudin
parent 3eeb3ec887
commit f920200be9
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
2 changed files with 4 additions and 2 deletions

View File

@ -73,7 +73,9 @@ func (r *rawChangeLoader) LoadFromTree(t *Tree, breakpoints []string) ([]*treech
// now starting from breakpoints
stack = stack[:0]
for _, h := range breakpoints {
stack = append(stack, t.attached[h])
if c, exists := t.attached[h]; exists {
stack = append(stack, c)
}
}
// doing another dfs to get all changes before breakpoints, we need to exclude them from results

View File

@ -62,5 +62,5 @@ func (s spaceKeys) HeaderKey() []byte {
}
func isRootIdKey(key string) bool {
return strings.HasPrefix(key, "t/") && strings.HasSuffix(key, "rootId")
return strings.HasPrefix(key, "t/") && strings.HasSuffix(key, "heads")
}