]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/precompose-autodetect-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2013 18:39:59 +0000 (11:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2013 18:39:59 +0000 (11:39 -0700)
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+

compat/precompose_utf8.c
t/t0050-filesystem.sh
t/t3910-mac-os-precompose.sh
t/t7400-submodule-basic.sh

index 7980abd1a71d0676f35eb300c46a30a7298e82f3..95fe849e42d3b9e1f7bc9590fcfac93016f38146 100644 (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);
index 05d78d22a6d0fa5534ae3f37cb3c289595b6c1c5..6b3cedcf24613b9c72c67b02c0b731db67055a26 100755 (executable)
@@ -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 &&
index 5fe57c5438e72150639fd6b970471a1689d30911..e4ba6013e41927bc0ec3ff3876648a71a71ce6e1 100755 (executable)
@@ -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" '
index 4192fe0ec6025979caea01885925c1786a4fcf63..10f89bd0ce3656a1dee841d19582e5d1bfc9736a 100755 (executable)
@@ -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")"