Re: [PATCH v4] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-14 Thread Jeff Hostetler
On 4/14/2017 3:52 PM, Jeff King wrote: On Fri, Apr 14, 2017 at 07:25:54PM +, g...@jeffhostetler.com wrote: for (i = 0; i < n; i++, dirmask >>= 1) { - const unsigned char *sha1 = NULL; - if (dirmask & 1) - sha1 = names[i].oid->hash;

Re: [PATCH v4] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-14 Thread Jeff King
On Fri, Apr 14, 2017 at 07:25:54PM +, g...@jeffhostetler.com wrote: > for (i = 0; i < n; i++, dirmask >>= 1) { > - const unsigned char *sha1 = NULL; > - if (dirmask & 1) > - sha1 = names[i].oid->hash; > - buf[i] = fill_tree_descript

[PATCH v4] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-14 Thread git
From: Jeff Hostetler Version 4 cleans up the buf[] allocation and freeing as suggested on the mailing list. Jeff Hostetler (1): unpack-trees: avoid duplicate ODB lookups during checkout unpack-trees.c | 38 +- 1 file changed, 33 insertions(+), 5 deletions(

[PATCH v4] unpack-trees: avoid duplicate ODB lookups during checkout

2017-04-14 Thread git
From: Jeff Hostetler Teach traverse_trees_recursive() to not do redundant ODB lookups when both directories refer to the same OID. In operations such as read-tree and checkout, there will likely be many peer directories that have the same OID when the differences between the commits are relative