ls-files: refactor away read_tree()
commit9614ad3ce09937f3124db09cc8c6dd2777a15515
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 20 Mar 2021 22:37:48 +0000 (20 23:37 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 20 Mar 2021 23:09:26 +0000 (20 16:09 -0700)
tree75e9bf80a4e47290f4d28ad05f27b05f5156da7b
parentfcc7c12f1139d5b1fd657a4e89425f07dbc78d8a
ls-files: refactor away read_tree()

Refactor away the read_tree() function into its only user,
overlay_tree_on_index().

First, change read_one_entry_opt() to use the strbuf parameter
read_tree_recursive() passes down in place. This finishes up a partial
refactoring started in 6a0b0b6de99 (tree.c: update read_tree_recursive
callback to pass strbuf as base, 2014-11-30).

Moving the rest into overlay_tree_on_index() makes this index juggling
we're doing easier to read.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-files.c