@@ -38,6 +38,7 @@ static enum list_objects_filter_result filter_blobs_none(
struct object *obj,
const char *pathname,
const char *filename,
+ struct index_state *istate,
void *filter_data_)
{
struct filter_blobs_none_data *filter_data = filter_data_;
@@ -94,6 +95,7 @@ static enum list_objects_filter_result filter_blobs_limit(
struct object *obj,
const char *pathname,
const char *filename,
+ struct index_state *istate,
void *filter_data_)
{
struct filter_blobs_limit_data *filter_data = filter_data_;
@@ -200,6 +202,7 @@ static enum list_objects_filter_result filter_sparse(
struct object *obj,
const char *pathname,
const char *filename,
+ struct index_state *istate,
void *filter_data_)
{
struct filter_sparse_data *filter_data = filter_data_;
@@ -216,7 +219,7 @@ static enum list_objects_filter_result filter_sparse(
dtype = DT_DIR;
val = is_excluded_from_list(pathname, strlen(pathname),
filename, &dtype, &filter_data->el,
- &the_index);
+ istate);
if (val < 0)
val = filter_data->array_frame[filter_data->nr].defval;
@@ -279,7 +282,7 @@ static enum list_objects_filter_result filter_sparse(
dtype = DT_REG;
val = is_excluded_from_list(pathname, strlen(pathname),
filename, &dtype, &filter_data->el,
- &the_index);
+ istate);
if (val < 0)
val = frame->defval;
if (val > 0) {
@@ -58,6 +58,7 @@ typedef enum list_objects_filter_result (*filter_object_fn)(
struct object *obj,
const char *pathname,
const char *filename,
+ struct index_state *istate,
void *filter_data);
typedef void (*filter_free_fn)(void *filter_data);
@@ -51,6 +51,7 @@ static void process_blob(struct rev_info *revs,
if (!(obj->flags & USER_GIVEN) && filter_fn)
r = filter_fn(LOFS_BLOB, obj,
path->buf, &path->buf[pathlen],
+ &the_index,
filter_data);
if (r & LOFR_MARK_SEEN)
obj->flags |= SEEN;
@@ -136,6 +137,7 @@ static void process_tree(struct rev_info *revs,
if (!(obj->flags & USER_GIVEN) && filter_fn)
r = filter_fn(LOFS_BEGIN_TREE, obj,
base->buf, &base->buf[baselen],
+ &the_index,
filter_data);
if (r & LOFR_MARK_SEEN)
obj->flags |= SEEN;
@@ -175,6 +177,7 @@ static void process_tree(struct rev_info *revs,
if (!(obj->flags & USER_GIVEN) && filter_fn) {
r = filter_fn(LOFS_END_TREE, obj,
base->buf, &base->buf[baselen],
+ &the_index,
filter_data);
if (r & LOFR_MARK_SEEN)
obj->flags |= SEEN;
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> --- list-objects-filter.c | 7 +++++-- list-objects-filter.h | 1 + list-objects.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-)