summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-05-24 10:11:08 +0200
committerJunio C Hamano <gitster@pobox.com>2016-06-01 10:10:16 -0700
commit0c1138cbdbf7a82f8373077b77a1878f742a5222 (patch)
tree0bcdd86ea8222af21b1eacfa3769bb1556adfe4a
parent82f0dfca542e95b74ff967f10fb4247e11a2d9d9 (diff)
downloadgit-0c1138cbdbf7a82f8373077b77a1878f742a5222.tar.gz
builtin/apply: move 'has_include' global into 'struct apply_state'
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>
-rw-r--r--builtin/apply.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 0e3de17d05..ebbc7111f8 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -55,6 +55,7 @@ struct apply_state {
/* Exclude and include path parameters */
struct string_list limit_by_name;
+ int has_include;
};
static int newfd = -1;
@@ -1961,7 +1962,6 @@ static void prefix_patch(struct apply_state *state, struct patch *p)
* include/exclude
*/
-static int has_include;
static void add_name_limit(struct apply_state *state,
const char *name,
int exclude)
@@ -1997,7 +1997,7 @@ static int use_patch(struct apply_state *state, struct patch *p)
* not used. Otherwise, we saw bunch of exclude rules (or none)
* and such a path is used.
*/
- return !has_include;
+ return !state->has_include;
}
@@ -4534,7 +4534,7 @@ static int option_parse_include(const struct option *opt,
{
struct apply_state *state = opt->value;
add_name_limit(state, arg, 0);
- has_include = 1;
+ state->has_include = 1;
return 0;
}