summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-04-28 13:38:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-28 19:15:21 (GMT)
commit4638728c632e59715b7346ddeca83528d37a4894 (patch)
tree2cdedb14547ccf6179e05ccc9556a9f47099b699 /submodule.h
parent860cba61a3eac38151fd203547df7515023303e9 (diff)
downloadgit-4638728c632e59715b7346ddeca83528d37a4894.zip
git-4638728c632e59715b7346ddeca83528d37a4894.tar.gz
git-4638728c632e59715b7346ddeca83528d37a4894.tar.bz2
submodule--helper: move config-sanitizing to submodule.c
These functions should be used by any code which spawns a submodule process, which may happen in submodule.c (e.g., for spawning fetch). Let's move them there and make them public so that submodule--helper can continue to use them. Since they're now public, let's also provide a basic overview of their intended use. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r--submodule.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h
index e06eaa5..48690b1 100644
--- a/submodule.h
+++ b/submodule.h
@@ -43,4 +43,20 @@ int find_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_nam
int push_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name);
void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir);
+/*
+ * This function is intended as a callback for use with
+ * git_config_from_parameters(). It ignores any config options which
+ * are not suitable for passing along to a submodule, and accumulates the rest
+ * in "data", which must be a pointer to a strbuf. The end result can
+ * be put into $GIT_CONFIG_PARAMETERS for passing to a sub-process.
+ */
+int sanitize_submodule_config(const char *var, const char *value, void *data);
+
+/*
+ * Prepare the "env_array" parameter of a "struct child_process" for executing
+ * a submodule by clearing any repo-specific envirionment variables, but
+ * retaining any config approved by sanitize_submodule_config().
+ */
+void prepare_submodule_repo_env(struct argv_array *out);
+
#endif