exclude: add flags parameter to add_patterns()
There are a number of callers of add_patterns() and its sibling functions. Let's give them a "flags" parameter for adding new options without having to touch each caller. We'll use this in a future patch to add O_NOFOLLOW support. But for now each caller just passes 0. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
dbf387d550
commit
1679d60bfc
@ -64,7 +64,7 @@ static int sparse_checkout_list(int argc, const char **argv)
|
||||
pl.use_cone_patterns = core_sparse_checkout_cone;
|
||||
|
||||
sparse_filename = get_sparse_checkout_filename();
|
||||
res = add_patterns_from_file_to_list(sparse_filename, "", 0, &pl, NULL);
|
||||
res = add_patterns_from_file_to_list(sparse_filename, "", 0, &pl, NULL, 0);
|
||||
free(sparse_filename);
|
||||
|
||||
if (res < 0) {
|
||||
@ -321,7 +321,7 @@ static int sparse_checkout_init(int argc, const char **argv)
|
||||
memset(&pl, 0, sizeof(pl));
|
||||
|
||||
sparse_filename = get_sparse_checkout_filename();
|
||||
res = add_patterns_from_file_to_list(sparse_filename, "", 0, &pl, NULL);
|
||||
res = add_patterns_from_file_to_list(sparse_filename, "", 0, &pl, NULL, 0);
|
||||
|
||||
/* If we already have a sparse-checkout file, use it. */
|
||||
if (res >= 0) {
|
||||
@ -483,7 +483,7 @@ static void add_patterns_cone_mode(int argc, const char **argv,
|
||||
existing.use_cone_patterns = core_sparse_checkout_cone;
|
||||
|
||||
if (add_patterns_from_file_to_list(sparse_filename, "", 0,
|
||||
&existing, NULL))
|
||||
&existing, NULL, 0))
|
||||
die(_("unable to load existing sparse-checkout patterns"));
|
||||
free(sparse_filename);
|
||||
|
||||
@ -507,7 +507,7 @@ static void add_patterns_literal(int argc, const char **argv,
|
||||
{
|
||||
char *sparse_filename = get_sparse_checkout_filename();
|
||||
if (add_patterns_from_file_to_list(sparse_filename, "", 0,
|
||||
pl, NULL))
|
||||
pl, NULL, 0))
|
||||
die(_("unable to load existing sparse-checkout patterns"));
|
||||
free(sparse_filename);
|
||||
add_patterns_from_input(pl, argc, argv);
|
||||
|
Reference in New Issue
Block a user