An error occurred while fetching the assigned milestone of the selected merge_request.
catfile: Introduce request queues to allow batching reads
1 unresolved thread
1 unresolved thread
Compare changes
- Patrick Steinhardt authored
When retrieving tree entries via the tree entries helper, then we request an object, parse it and then recursively parse its children in case it is a tree object. When the object is not a tree, then we discard its contents via a deferred call and exit early. Otherwise, if it is a tree, we'd still try to discard the tree object _after_ we have parsed all of its children. This is invalid though given that objects returned by the catfile package cannot be read in arbitrary order, but instead they must always be fully read before trying to read the next object. Discarding contents at the end thus cannot work as expected. Fix the bug by explicitly discarding the object in case it's not a tree. In the other case, where it is a tree, we'll pass the reader to `extractEntryInfoFromTreeData()`: this function either returns an error in case we're unable to parse the tree, or otherwise it has fully consumed the tree object. Discarding it is thus not necessary in that case. Changelog: fixed
@@ -143,16 +143,15 @@ func treeEntries(