Skip to content

Commit 97616ca

Browse files
committed
Merge branch 'en/unicode-in-refnames'
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
2 parents 85ac27e + 8e712ef commit 97616ca

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

builtin/pack-refs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "builtin.h"
2+
#include "config.h"
23
#include "parse-options.h"
34
#include "refs.h"
45
#include "repository.h"
@@ -16,6 +17,7 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
1617
OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
1718
OPT_END(),
1819
};
20+
git_config(git_default_config, NULL);
1921
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
2022
usage_with_options(pack_refs_usage, opts);
2123
return refs_pack_refs(get_main_ref_store(the_repository), flags);

builtin/show-ref.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "builtin.h"
22
#include "cache.h"
3+
#include "config.h"
34
#include "refs.h"
45
#include "object-store.h"
56
#include "object.h"
@@ -182,6 +183,8 @@ static const struct option show_ref_options[] = {
182183

183184
int cmd_show_ref(int argc, const char **argv, const char *prefix)
184185
{
186+
git_config(git_default_config, NULL);
187+
185188
argc = parse_options(argc, argv, prefix, show_ref_options,
186189
show_ref_usage, 0);
187190

upload-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
10691069
allow_ref_in_want = git_config_bool(var, value);
10701070
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
10711071
allow_sideband_all = git_config_bool(var, value);
1072+
} else if (!strcmp("core.precomposeunicode", var)) {
1073+
precomposed_unicode = git_config_bool(var, value);
10721074
}
10731075

10741076
if (current_config_scope() != CONFIG_SCOPE_REPO) {

0 commit comments

Comments
 (0)