Set core.precomposeunicode to true on e.g. HFS+
When core.precomposeunicode was introduced in 76759c7d, it was set to false on a unicode decomposing file system like HFS+ to be compatible with older versions of Git. The Mac OS users need to find out that this configuration exist and change it manually from false to true. A smoother workflow can be achieved, so set core.precomposeunicode to true on a decomposing file system. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen committed
Aug 27, 2013 at 15:50 UTC
92b0c8bed0d3f6ed5442e3ffa178413772faa31b
4 files changed
+4
-7
compat/precompose_utf8.c
+2
-5
@@ -48,11 +48,8 @@ void probe_utf8_pathname_composition(char *path, int len)
48
if (output_fd >= 0) {
49
close(output_fd);
50
strcpy(path + len, auml_nfd);
51
- /* Indicate to the user, that we can configure it to true */
52
- if (!access(path, R_OK))
53
- git_config_set("core.precomposeunicode", "false");
54
- /* To be backward compatible, set precomposed_unicode to 0 */
55
- precomposed_unicode = 0;
51
+ precomposed_unicode = access(path, R_OK) ? 0 : 1;
52
+ git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");
53
strcpy(path + len, auml_nfc);
54
if (unlink(path))
55
die_errno(_("failed to unlink '%s'"), path);
t/t0050-filesystem.sh
+1
@@ -91,6 +91,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
91
test_expect_success "setup unicode normalization tests" '
92
test_create_repo unicode &&
93
cd unicode &&
94
+ git config core.precomposeunicode false &&
95
touch "$aumlcdiar" &&
96
git add "$aumlcdiar" &&
97
git commit -m initial &&
t/t3910-mac-os-precompose.sh
+1
-1
@@ -36,7 +36,7 @@ Alongc=$Alongc$AEligatu$AEligatu #254 Byte
36
37
test_expect_success "detect if nfd needed" '
38
precomposeunicode=`git config core.precomposeunicode` &&
39
- test "$precomposeunicode" = false &&
39
+ test "$precomposeunicode" = true &&
40
git config core.precomposeunicode true
41
'
42
test_expect_success "setup" '
t/t7400-submodule-basic.sh
-1
@@ -958,7 +958,6 @@ test_expect_success 'submodule with UTF-8 name' '
958
git add sub &&
959
git commit -m "init sub"
960
) &&
961
- test_config core.precomposeunicode true &&
961
git submodule add ./"$svname" &&
962
git submodule >&2 &&
963
test -n "$(git submodule | grep "$svname")"