Re: [PATCHv4 3/7] revision.h: introduce blob/tree walking in order of the commits
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Nov 15, 2017, 01:38 UTC
- Message-ID
- <20171114173812.9ac53b0cf0aa93db08d6559c@google.com>
- In-Reply-To
- <20171115003043.24080-4-sbeller@google.com>
On Tue, 14 Nov 2017 16:30:39 -0800 Stefan Beller <sbeller@google.com> wrote:
Show 6 quoted lines
> The change in list-objects.c is rather minimal as we'll be re-using > the infrastructure put in place of the revision walking machinery. For > example one could expect that add_pending_tree is not called, but rather > commit->tree is directly passed to the tree traversal function. This > however requires a lot more code than just emptying the queue containing > trees after each commit.
Ah, I see. You're calling add_pending_tree(), then traverse_trees_and_blobs() will immediately flush the list of pending trees.
I'm not sure that passing commit->tree directly to the tree traversal function will require a lot more code, but even if it does, you should at least add a NEEDSWORK - currently, flushing the list of pending trees frees the array containing the list of pending trees, so each invocation will need to reallocate a new array.