Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use the sorted input in the tree updater #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 14, 2016
Merged

Conversation

carlosmn
Copy link
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
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