mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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>
This commit is contained in:
parent
e230c568c4
commit
92b0c8bed0
|
@ -48,11 +48,8 @@ void probe_utf8_pathname_composition(char *path, int len)
|
||||||
if (output_fd >= 0) {
|
if (output_fd >= 0) {
|
||||||
close(output_fd);
|
close(output_fd);
|
||||||
strcpy(path + len, auml_nfd);
|
strcpy(path + len, auml_nfd);
|
||||||
/* Indicate to the user, that we can configure it to true */
|
precomposed_unicode = access(path, R_OK) ? 0 : 1;
|
||||||
if (!access(path, R_OK))
|
git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");
|
||||||
git_config_set("core.precomposeunicode", "false");
|
|
||||||
/* To be backward compatible, set precomposed_unicode to 0 */
|
|
||||||
precomposed_unicode = 0;
|
|
||||||
strcpy(path + len, auml_nfc);
|
strcpy(path + len, auml_nfc);
|
||||||
if (unlink(path))
|
if (unlink(path))
|
||||||
die_errno(_("failed to unlink '%s'"), path);
|
die_errno(_("failed to unlink '%s'"), path);
|
||||||
|
|
|
@ -91,6 +91,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
|
||||||
test_expect_success "setup unicode normalization tests" '
|
test_expect_success "setup unicode normalization tests" '
|
||||||
test_create_repo unicode &&
|
test_create_repo unicode &&
|
||||||
cd unicode &&
|
cd unicode &&
|
||||||
|
git config core.precomposeunicode false &&
|
||||||
touch "$aumlcdiar" &&
|
touch "$aumlcdiar" &&
|
||||||
git add "$aumlcdiar" &&
|
git add "$aumlcdiar" &&
|
||||||
git commit -m initial &&
|
git commit -m initial &&
|
||||||
|
|
|
@ -36,7 +36,7 @@ Alongc=$Alongc$AEligatu$AEligatu #254 Byte
|
||||||
|
|
||||||
test_expect_success "detect if nfd needed" '
|
test_expect_success "detect if nfd needed" '
|
||||||
precomposeunicode=`git config core.precomposeunicode` &&
|
precomposeunicode=`git config core.precomposeunicode` &&
|
||||||
test "$precomposeunicode" = false &&
|
test "$precomposeunicode" = true &&
|
||||||
git config core.precomposeunicode true
|
git config core.precomposeunicode true
|
||||||
'
|
'
|
||||||
test_expect_success "setup" '
|
test_expect_success "setup" '
|
||||||
|
|
|
@ -958,7 +958,6 @@ test_expect_success 'submodule with UTF-8 name' '
|
||||||
git add sub &&
|
git add sub &&
|
||||||
git commit -m "init sub"
|
git commit -m "init sub"
|
||||||
) &&
|
) &&
|
||||||
test_config core.precomposeunicode true &&
|
|
||||||
git submodule add ./"$svname" &&
|
git submodule add ./"$svname" &&
|
||||||
git submodule >&2 &&
|
git submodule >&2 &&
|
||||||
test -n "$(git submodule | grep "$svname")"
|
test -n "$(git submodule | grep "$svname")"
|
||||||
|
|
Loading…
Reference in a new issue