Skip to content

Commit 92b0c8b

Browse files
tboegigitster
authored andcommitted
Set core.precomposeunicode to true on e.g. HFS+
When core.precomposeunicode was introduced in 76759c7, 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e230c56 commit 92b0c8b

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
@@ -958,7 +958,6 @@ test_expect_success 'submodule with UTF-8 name' '
958958
git add sub &&
959959
git commit -m "init sub"
960960
) &&
961-
test_config core.precomposeunicode true &&
962961
git submodule add ./"$svname" &&
963962
git submodule >&2 &&
964963
test -n "$(git submodule | grep "$svname")"

0 commit comments

Comments
 (0)