Skip to content

Use the sorted input in the tree updater#4003

Merged
ethomson merged 3 commits into
masterfrom
cmn/tree-updater-ordering
Nov 14, 2016
Merged

Use the sorted input in the tree updater#4003
ethomson merged 3 commits into
masterfrom
cmn/tree-updater-ordering

Conversation

@carlosmn

Copy link
Copy Markdown
Member

The loop/algo is made to assume that we have sorted inputs. We sort them to make sure but we failed to actually use the sorted list. The tests were inadvertently written with inputs that did not show this bad behaviour.

This fixes #3804

We do not currently use the sorted version of this input in the
function, which means we produce bad results.
The loop is made with the assumption that the inputs are sorted and not
using it leads to bad outputs.
We look at whether we're trying to replace a blob with a tree during the
update phase, but we fail to look at whether we've just inserted a blob
where we're now trying to insert a tree.

Update the check to look at both places. The test for this was
previously succeeding due to the bu where we did not look at the sorted
output.
@carlosmn carlosmn added this to the libgit2 v0.25 - Rutschgefahr milestone Nov 14, 2016
@ethomson

Copy link
Copy Markdown
Member

👍

@ethomson ethomson merged commit df045ce into master Nov 14, 2016
@carlosmn carlosmn deleted the cmn/tree-updater-ordering branch November 15, 2016 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tree updater does not use the sorted inputs

2 participants