Merge branch 'ab/read-tree'

Code simplification by removing support for a caller that is long gone.

* ab/read-tree:
  tree.h API: simplify read_tree_recursive() signature
  tree.h API: expose read_tree_1() as read_tree_at()
  archive: stop passing "stage" through read_tree_recursive()
  ls-files: refactor away read_tree()
  ls-files: don't needlessly pass around stage variable
  tree.c API: move read_tree() into builtin/ls-files.c
  ls-files tests: add meaningful --with-tree tests
  show tests: add test for "git show <tree>"
This commit is contained in:
Junio C Hamano
2021-03-30 14:35:37 -07:00
11 changed files with 205 additions and 147 deletions

View File

@ -453,7 +453,7 @@ static void unpack_trees_finish(struct merge_options *opt)
static int save_files_dirs(const struct object_id *oid,
struct strbuf *base, const char *path,
unsigned int mode, int stage, void *context)
unsigned int mode, void *context)
{
struct path_hashmap_entry *entry;
int baselen = base->len;
@ -473,8 +473,8 @@ static void get_files_dirs(struct merge_options *opt, struct tree *tree)
{
struct pathspec match_all;
memset(&match_all, 0, sizeof(match_all));
read_tree_recursive(opt->repo, tree, "", 0, 0,
&match_all, save_files_dirs, opt);
read_tree(opt->repo, tree,
&match_all, save_files_dirs, opt);
}
static int get_tree_entry_if_blob(struct repository *r,