@@ -317,10 +317,10 @@ int write_archive_entries(struct archiver_args *args,
git_attr_set_direction(GIT_ATTR_INDEX);
}
- err = read_tree_recursive(args->repo, args->tree,
- &args->pathspec,
- queue_or_write_archive_entry,
- &context);
+ err = read_tree(args->repo, args->tree,
+ &args->pathspec,
+ queue_or_write_archive_entry,
+ &context);
if (err == READ_TREE_RECURSIVE)
err = 0;
while (context.bottom) {
@@ -406,9 +406,9 @@ static int path_exists(struct archiver_args *args, const char *path)
ctx.args = args;
parse_pathspec(&ctx.pathspec, 0, 0, "", paths);
ctx.pathspec.recursive = 1;
- ret = read_tree_recursive(args->repo, args->tree,
- &ctx.pathspec,
- reject_entry, &ctx);
+ ret = read_tree(args->repo, args->tree,
+ &ctx.pathspec,
+ reject_entry, &ctx);
clear_pathspec(&ctx.pathspec);
return ret != 0;
}
@@ -155,8 +155,8 @@ static int update_some(const struct object_id *oid, struct strbuf *base,
static int read_tree_some(struct tree *tree, const struct pathspec *pathspec)
{
- read_tree_recursive(the_repository, tree,
- pathspec, update_some, NULL);
+ read_tree(the_repository, tree,
+ pathspec, update_some, NULL);
/* update the index with the given tree's info
* for all args, expanding wildcards, and exit
@@ -322,7 +322,7 @@ static void mark_ce_for_checkout_overlay(struct cache_entry *ce,
* If it comes from the tree-ish, we already know it
* matches the pathspec and could just stamp
* CE_MATCHED to it from update_some(). But we still
- * need ps_matched and read_tree_recursive (and
+ * need ps_matched and read_tree (and
* eventually tree_entry_interesting) cannot fill
* ps_matched yet. Once it can, we can avoid calling
* match_pathspec() for _all_ entries when
@@ -681,9 +681,9 @@ int cmd_show(int argc, const char **argv, const char *prefix)
diff_get_color_opt(&rev.diffopt, DIFF_COMMIT),
name,
diff_get_color_opt(&rev.diffopt, DIFF_RESET));
- read_tree_recursive(the_repository, (struct tree *)o,
- &match_all, show_tree_object,
- rev.diffopt.file);
+ read_tree(the_repository, (struct tree *)o,
+ &match_all, show_tree_object,
+ rev.diffopt.file);
rev.shown_one = 1;
break;
case OBJ_COMMIT:
@@ -523,7 +523,7 @@ void overlay_tree_on_index(struct index_state *istate,
if (!fn)
fn = read_one_entry_quick;
- err = read_tree_recursive(the_repository, tree, &pathspec, fn, istate);
+ err = read_tree(the_repository, tree, &pathspec, fn, istate);
if (err)
die("unable to read tree entries %s", tree_name);
@@ -185,6 +185,6 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
tree = parse_tree_indirect(&oid);
if (!tree)
die("not a tree object");
- return !!read_tree_recursive(the_repository, tree,
- &pathspec, show_tree, NULL);
+ return !!read_tree(the_repository, tree,
+ &pathspec, show_tree, NULL);
}
@@ -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,
- &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,
@@ -81,10 +81,10 @@ static int read_tree_1(struct repository *r,
return 0;
}
-int read_tree_recursive(struct repository *r,
- struct tree *tree,
- const struct pathspec *pathspec,
- read_tree_fn_t fn, void *context)
+int read_tree(struct repository *r,
+ struct tree *tree,
+ const struct pathspec *pathspec,
+ read_tree_fn_t fn, void *context)
{
struct strbuf sb = STRBUF_INIT;
int ret;
@@ -33,8 +33,8 @@ int cmp_cache_name_compare(const void *a_, const void *b_);
#define READ_TREE_RECURSIVE 1
typedef int (*read_tree_fn_t)(const struct object_id *, struct strbuf *, const char *, unsigned int, void *);
-int read_tree_recursive(struct repository *r,
- struct tree *tree,
- const struct pathspec *pathspec,
- read_tree_fn_t fn, void *context);
+int read_tree(struct repository *r,
+ struct tree *tree,
+ const struct pathspec *pathspec,
+ read_tree_fn_t fn, void *context);
#endif /* TREE_H */
Rename the read_tree_recursive() function to just read_tree(). We had another read_tree() function that I've refactored away in preceding steps, since all in-tree users read trees recursively with a callback we can change the name to signify that this is the norm. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- archive.c | 14 +++++++------- builtin/checkout.c | 6 +++--- builtin/log.c | 6 +++--- builtin/ls-files.c | 2 +- builtin/ls-tree.c | 4 ++-- merge-recursive.c | 4 ++-- tree.c | 8 ++++---- tree.h | 8 ++++---- 8 files changed, 26 insertions(+), 26 deletions(-)