diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2015-08-17 17:21:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-19 11:43:10 -0700 |
commit | 851e18c3859ad0f9f7e91fdb4d6cce5a8272420b (patch) | |
tree | 174141bad5af8da81d0eb6272584eadfa1906c74 /test-submodule-config.c | |
parent | 0d9f282c943a0799999176a2d8291ecbad060389 (diff) | |
download | git-851e18c3859ad0f9f7e91fdb4d6cce5a8272420b.tar.gz |
submodule: use new config API for worktree configurations
We remove the extracted functions and directly parse into and read out
of the cache. This allows us to have one unified way of accessing
submodule configuration values specific to single submodules. Regardless
whether we need to access a configuration from history or from the
worktree.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-submodule-config.c')
-rw-r--r-- | test-submodule-config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test-submodule-config.c b/test-submodule-config.c index f3c391860d..dab8c27768 100644 --- a/test-submodule-config.c +++ b/test-submodule-config.c @@ -1,5 +1,6 @@ #include "cache.h" #include "submodule-config.h" +#include "submodule.h" static void die_usage(int argc, char **argv, const char *msg) { @@ -8,6 +9,11 @@ static void die_usage(int argc, char **argv, const char *msg) exit(1); } +static int git_test_config(const char *var, const char *value, void *cb) +{ + return parse_submodule_config_option(var, value); +} + int main(int argc, char **argv) { char **arg = argv; @@ -29,6 +35,10 @@ int main(int argc, char **argv) if (my_argc % 2 != 0) die_usage(argc, argv, "Wrong number of arguments."); + setup_git_directory(); + gitmodules_config(); + git_config(git_test_config, NULL); + while (*arg) { unsigned char commit_sha1[20]; const struct submodule *submodule; |