Merge branch 'en/unicode-in-refnames'
authorJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:30 +0000 (16:45 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 19 May 2019 07:45:30 +0000 (16:45 +0900)
On a filesystem like HFS+, the names of the refs stored as filesystem
entities may become different from what the end-user expects, just
like files in the working tree get "renamed". Work around the
mismatch by paying attention to the core.precomposeUnicode
configuration.

* en/unicode-in-refnames:
Honor core.precomposeUnicode in more places

builtin/pack-refs.c
builtin/show-ref.c
upload-pack.c
index f3353564f99205b278362484abcdf1537058ef29..cfbd5c36c7640bc841a68bb5a524f025c43212fd 100644 (file)
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "config.h"
 #include "parse-options.h"
 #include "refs.h"
 #include "repository.h"
@@ -16,6 +17,7 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
                OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
                OPT_END(),
        };
+       git_config(git_default_config, NULL);
        if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
                usage_with_options(pack_refs_usage, opts);
        return refs_pack_refs(get_main_ref_store(the_repository), flags);
index 6a706c02a6f9782ee4abb289cfafe468253aca1f..6456da70cc2c4d6a86c2466c483dd815b15bbb45 100644 (file)
@@ -1,5 +1,6 @@
 #include "builtin.h"
 #include "cache.h"
+#include "config.h"
 #include "refs.h"
 #include "object-store.h"
 #include "object.h"
@@ -182,6 +183,8 @@ static const struct option show_ref_options[] = {
 
 int cmd_show_ref(int argc, const char **argv, const char *prefix)
 {
+       git_config(git_default_config, NULL);
+
        argc = parse_options(argc, argv, prefix, show_ref_options,
                             show_ref_usage, 0);
 
index d2ea5eb20d90557de4dc979d98a9479e0c2e7d9b..24298913c0d7932e20f4677d3b8a4ea62ed69f8d 100644 (file)
@@ -1069,6 +1069,8 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
                allow_ref_in_want = git_config_bool(var, value);
        } else if (!strcmp("uploadpack.allowsidebandall", var)) {
                allow_sideband_all = git_config_bool(var, value);
+       } else if (!strcmp("core.precomposeunicode", var)) {
+               precomposed_unicode = git_config_bool(var, value);
        }
 
        if (current_config_scope() != CONFIG_SCOPE_REPO) {