summaryrefslogtreecommitdiffstats
path: root/submodule-config.h
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2018-06-26 12:47:05 +0200
committerJunio C Hamano <gitster@pobox.com>2018-06-26 12:56:11 -0700
commitad136370b2a26fd55f446722ff7bf5b383e8eca0 (patch)
tree3c1df9d011449e4720af32bf42fd52c95b4692a4 /submodule-config.h
parented843436dd4924c10669820cc73daf50f0b4dabd (diff)
downloadgit-ad136370b2a26fd55f446722ff7bf5b383e8eca0.tar.gz
git-ad136370b2a26fd55f446722ff7bf5b383e8eca0.tar.xz
config: move config_from_gitmodules to submodule-config.c
The .gitmodules file is not meant as a place to store arbitrary configuration to distribute with the repository. Move config_from_gitmodules() out of config.c and into submodule-config.c to make it even clearer that it is not a mechanism to retrieve arbitrary configuration from the .gitmodules file. Signed-off-by: Antonio Ospite <ao2@ao2.it> Acked-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.h')
-rw-r--r--submodule-config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/submodule-config.h b/submodule-config.h
index ca1f94e2d..5148801f4 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -2,6 +2,7 @@
#define SUBMODULE_CONFIG_CACHE_H
#include "cache.h"
+#include "config.h"
#include "hashmap.h"
#include "submodule.h"
#include "strbuf.h"
@@ -55,4 +56,14 @@ void submodule_free(struct repository *r);
*/
int check_submodule_name(const char *name);
+/*
+ * Note: This function exists solely to maintain backward compatibility with
+ * 'fetch' and 'update_clone' storing configuration in '.gitmodules' and should
+ * NOT be used anywhere else.
+ *
+ * Runs the provided config function on the '.gitmodules' file found in the
+ * working directory.
+ */
+extern void config_from_gitmodules(config_fn_t fn, void *data);
+
#endif /* SUBMODULE_CONFIG_H */