To libify the apply functionality the 'has_include' variable should
not be static and global to the file. Let's move it into
'struct apply_state'.
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
/* Exclude and include path parameters */
struct string_list limit_by_name;
+ int has_include;
};
static int newfd = -1;
* include/exclude
*/
-static int has_include;
static void add_name_limit(struct apply_state *state,
const char *name,
int exclude)
* not used. Otherwise, we saw bunch of exclude rules (or none)
* and such a path is used.
*/
- return !has_include;
+ return !state->has_include;
}
{
struct apply_state *state = opt->value;
add_name_limit(state, arg, 0);
- has_include = 1;
+ state->has_include = 1;
return 0;
}