Skip to content

Commit f2ded0f

Browse files
committed
Merge branch 'tb/precompose-autodetect-fix'
On MacOS X, we detected if the filesystem needs the "pre-composed unicode strings" workaround, but did not automatically enable it. Now we do. * tb/precompose-autodetect-fix: Set core.precomposeunicode to true on e.g. HFS+
2 parents 22a6f31 + 92b0c8b commit f2ded0f

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

compat/precompose_utf8.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ void probe_utf8_pathname_composition(char *path, int len)
4848
if (output_fd >= 0) {
4949
close(output_fd);
5050
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");
5653
strcpy(path + len, auml_nfc);
5754
if (unlink(path))
5855
die_errno(_("failed to unlink '%s'"), path);

t/t0050-filesystem.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
9191
test_expect_success "setup unicode normalization tests" '
9292
test_create_repo unicode &&
9393
cd unicode &&
94+
git config core.precomposeunicode false &&
9495
touch "$aumlcdiar" &&
9596
git add "$aumlcdiar" &&
9697
git commit -m initial &&

t/t3910-mac-os-precompose.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Alongc=$Alongc$AEligatu$AEligatu #254 Byte
3636

3737
test_expect_success "detect if nfd needed" '
3838
precomposeunicode=`git config core.precomposeunicode` &&
39-
test "$precomposeunicode" = false &&
39+
test "$precomposeunicode" = true &&
4040
git config core.precomposeunicode true
4141
'
4242
test_expect_success "setup" '

t/t7400-submodule-basic.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ test_expect_success 'submodule with UTF-8 name' '
962962
git add sub &&
963963
git commit -m "init sub"
964964
) &&
965-
test_config core.precomposeunicode true &&
966965
git submodule add ./"$svname" &&
967966
git submodule >&2 &&
968967
test -n "$(git submodule | grep "$svname")"

0 commit comments

Comments
 (0)