summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-17 21:22:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-17 21:22:17 (GMT)
commit5d55554b1d099f3ae5e74f6d058edb55161510de (patch)
treef3c4a640addac61a756693580814627f76ea62e6 /t/helper
parent9f3f38769d49255d3fbf97f35a0dec591de17db3 (diff)
parent145d59f48233c64cb8a9262c9f1451cc7d66b530 (diff)
downloadgit-5d55554b1d099f3ae5e74f6d058edb55161510de.zip
git-5d55554b1d099f3ae5e74f6d058edb55161510de.tar.gz
git-5d55554b1d099f3ae5e74f6d058edb55161510de.tar.bz2
Merge branch 'mr/show-config-scope'
"git config" learned to show in which "scope", in addition to in which file, each config setting comes from. * mr/show-config-scope: config: add '--show-scope' to print the scope of a config value submodule-config: add subomdule config scope config: teach git_config_source to remember its scope config: preserve scope in do_git_config_sequence config: clarify meaning of command line scoping config: split repo scope to local and worktree config: make scope_name non-static and rename it t1300: create custom config file without special characters t1300: fix over-indented HERE-DOCs config: fix typo in variable name
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-config.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index 214003d..1e3bc7c 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -37,21 +37,6 @@
*
*/
-static const char *scope_name(enum config_scope scope)
-{
- switch (scope) {
- case CONFIG_SCOPE_SYSTEM:
- return "system";
- case CONFIG_SCOPE_GLOBAL:
- return "global";
- case CONFIG_SCOPE_REPO:
- return "repo";
- case CONFIG_SCOPE_CMDLINE:
- return "cmdline";
- default:
- return "unknown";
- }
-}
static int iterate_cb(const char *var, const char *value, void *data)
{
static int nr;
@@ -63,7 +48,7 @@ static int iterate_cb(const char *var, const char *value, void *data)
printf("value=%s\n", value ? value : "(null)");
printf("origin=%s\n", current_config_origin_type());
printf("name=%s\n", current_config_name());
- printf("scope=%s\n", scope_name(current_config_scope()));
+ printf("scope=%s\n", config_scope_name(current_config_scope()));
return 0;
}