mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-23 05:38:41 +00:00
Merge pull request #3537 from libgit2/cmn/tree-is-sorted
tree: mark a tree as already sorted
This commit is contained in:
commit
d698929cdd
@ -13,6 +13,10 @@ v0.23 + 1
|
|||||||
* You can now set your own user-agent to be sent for HTTP requests by
|
* You can now set your own user-agent to be sent for HTTP requests by
|
||||||
using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
|
using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`.
|
||||||
|
|
||||||
|
* Tree objects are now assumed to be sorted. If a tree is not
|
||||||
|
correctly formed, it will give bad results. This is the git approach
|
||||||
|
and cuts a significant amount of time when reading the trees.
|
||||||
|
|
||||||
### API additions
|
### API additions
|
||||||
|
|
||||||
* `git_config_lock()` has been added, which allow for
|
* `git_config_lock()` has been added, which allow for
|
||||||
|
@ -476,7 +476,8 @@ int git_tree__parse(void *_tree, git_odb_object *odb_obj)
|
|||||||
buffer += GIT_OID_RAWSZ;
|
buffer += GIT_OID_RAWSZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
git_vector_sort(&tree->entries);
|
/* The tree is sorted by definition. Bad inputs give bad outputs */
|
||||||
|
tree->entries.flags |= GIT_VECTOR_SORTED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user