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+
This commit is contained in:
Junio C Hamano 2013-09-17 11:39:59 -07:00
commit f2ded0f807
4 changed files with 4 additions and 7 deletions

View File

@ -48,11 +48,8 @@ void probe_utf8_pathname_composition(char *path, int len)
if (output_fd >= 0) {
close(output_fd);
strcpy(path + len, auml_nfd);
/* Indicate to the user, that we can configure it to true */
if (!access(path, R_OK))
git_config_set("core.precomposeunicode", "false");
/* To be backward compatible, set precomposed_unicode to 0 */
precomposed_unicode = 0;
precomposed_unicode = access(path, R_OK) ? 0 : 1;
git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");
strcpy(path + len, auml_nfc);
if (unlink(path))
die_errno(_("failed to unlink '%s'"), path);

View File

@ -91,6 +91,7 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
test_expect_success "setup unicode normalization tests" '
test_create_repo unicode &&
cd unicode &&
git config core.precomposeunicode false &&
touch "$aumlcdiar" &&
git add "$aumlcdiar" &&
git commit -m initial &&

View File

@ -36,7 +36,7 @@ Alongc=$Alongc$AEligatu$AEligatu #254 Byte
test_expect_success "detect if nfd needed" '
precomposeunicode=`git config core.precomposeunicode` &&
test "$precomposeunicode" = false &&
test "$precomposeunicode" = true &&
git config core.precomposeunicode true
'
test_expect_success "setup" '

View File

@ -962,7 +962,6 @@ test_expect_success 'submodule with UTF-8 name' '
git add sub &&
git commit -m "init sub"
) &&
test_config core.precomposeunicode true &&
git submodule add ./"$svname" &&
git submodule >&2 &&
test -n "$(git submodule | grep "$svname")"