]> git.ipfire.org Git - thirdparty/git.git/commit - list-objects.c
list-objects.c: factor out traverse_trees_and_blobs
authorStefan Beller <sbeller@google.com>
Thu, 2 Nov 2017 19:41:43 +0000 (12:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Nov 2017 14:12:06 +0000 (23:12 +0900)
commit91904f5645196ceef92c6fca21cc9454928613f0
tree78b179c532684a9830f74b073e0dc26a6a9b6698
parent2deda00707f8278382d64c696d75f33cc16e1233
list-objects.c: factor out traverse_trees_and_blobs

With traverse_trees_and_blobs factored out of the main traverse function,
the next patch can introduce an in-order revision walking with ease.

In the next patch we'll call `traverse_trees_and_blobs` from within the
loop walking the commits, such that we'll have one invocation of that
function per commit.  That is why we do not want to have memory allocations
in that function, such as we'd have if we were to use a strbuf locally.
Pass a strbuf from traverse_commit_list into the blob and tree traversing
function as a scratch pad that only needs to be allocated once.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects.c