]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3910-mac-os-precompose.sh
Merge branch 'js/range-diff-wo-dotdot'
[thirdparty/git.git] / t / t3910-mac-os-precompose.sh
index 54ce19e353d924de08d4242f519fef7a44ce4787..898267a6bd1c8d1320c8e808707ba079c39933fe 100755 (executable)
@@ -5,6 +5,9 @@
 
 test_description='utf-8 decomposed (nfd) converted to precomposed (nfc)'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 if ! test_have_prereq UTF8_NFD_TO_NFC
@@ -151,7 +154,7 @@ test_expect_success "git checkout link nfd" '
        git checkout l.$Odiarnfd
 '
 test_expect_success "setup case mac2" '
-       git checkout master &&
+       git checkout main &&
        git reset --hard &&
        git checkout -b mac_os_2
 '
@@ -163,7 +166,7 @@ test_expect_success "commit file d2.Adiarnfd/f.Adiarnfd" '
        git commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd
 '
 test_expect_success "setup for long decomposed filename" '
-       git checkout master &&
+       git checkout main &&
        git reset --hard &&
        git checkout -b mac_os_long_nfd_fn
 '
@@ -173,7 +176,7 @@ test_expect_success "Add long decomposed filename" '
        git commit -m "Long filename"
 '
 test_expect_success "setup for long precomposed filename" '
-       git checkout master &&
+       git checkout main &&
        git reset --hard &&
        git checkout -b mac_os_long_nfc_fn
 '
@@ -191,6 +194,22 @@ test_expect_failure 'handle existing decomposed filenames' '
        test_must_be_empty untracked
 '
 
+test_expect_success "unicode decomposed: git restore -p . " '
+       DIRNAMEPWD=dir.Odiarnfc &&
+       DIRNAMEINREPO=dir.$Adiarnfc &&
+       export DIRNAMEPWD DIRNAMEINREPO &&
+       git init "$DIRNAMEPWD" &&
+       (
+               cd "$DIRNAMEPWD" &&
+               mkdir "$DIRNAMEINREPO" &&
+               cd "$DIRNAMEINREPO" &&
+               echo "Initial" >file &&
+               git add file &&
+               echo "More stuff" >>file &&
+               echo y | git restore -p .
+       )
+'
+
 # Test if the global core.precomposeunicode stops autosensing
 # Must be the last test case
 test_expect_success "respect git config --global core.precomposeunicode" '