Commit Graph

5 Commits

Author SHA1 Message Date
Carlos Martín Nieto
1d41b86cd0 tree: add a failing test for unsorted input
We do not currently use the sorted version of this input in the
function, which means we produce bad results.
2016-11-14 12:22:20 +01:00
Carlos Martín Nieto
a2cb47130e tree: handle removal of all entries in the updater
When we remove all entries in a tree, we should remove that tree from
its parent rather than include the empty tree.
2016-05-24 14:30:43 +02:00
Carlos Martín Nieto
5341230536 tree: plug leaks in the tree updater 2016-05-19 15:29:53 +02:00
Carlos Martín Nieto
922496562b tree: use testrepo2 for the tree updater tests
This gives us trees with subdirectories, which the new test needs.
2016-05-19 15:21:26 +02:00
Carlos Martín Nieto
9464f9ebc1 Introduce a function to create a tree based on a different one
Instead of going through the usual steps of reading a tree recursively
into an index, modifying it and writing it back out as a tree, introduce
a function to perform simple updates more efficiently.

`git_tree_create_updated` avoids reading trees which are not modified
and supports upsert and delete operations. It is not as versatile as
modifying the index, but it makes some common operations much more
efficient.
2016-05-17 17:41:05 +02:00