Add a pointer parameter to read_tree_recursive(), which is passed to the
callback function. This allows callers of read_tree_recursive() to
share data with the callback without resorting to global variables. All
current callers pass NULL.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
René Scharfe17 years agocommitted byJunio C Hamano
@ -29,7 +29,7 @@ static int read_one_entry_opt(const unsigned char *sha1, const char *base, int b
@@ -29,7 +29,7 @@ static int read_one_entry_opt(const unsigned char *sha1, const char *base, int b
return add_cache_entry(ce, opt);
}
static int read_one_entry(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned mode, int stage)
static int read_one_entry(const unsigned char *sha1, const char *base, int baselen, const char *pathname, unsigned mode, int stage, void *context)
@ -92,7 +92,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
@@ -92,7 +92,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
int read_tree_recursive(struct tree *tree,
const char *base, int baselen,
int stage, const char **match,
read_tree_fn_t fn)
read_tree_fn_t fn, void *context)
{
struct tree_desc desc;
struct name_entry entry;
@ -106,7 +106,7 @@ int read_tree_recursive(struct tree *tree,
@@ -106,7 +106,7 @@ int read_tree_recursive(struct tree *tree,
if (!match_tree_entry(base, baselen, entry.path, entry.mode, match))
@ -174,7 +174,7 @@ int read_tree(struct tree *tree, int stage, const char **match)
@@ -174,7 +174,7 @@ int read_tree(struct tree *tree, int stage, const char **match)