Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t4048-diff-combined-binary.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t4048-diff-combined-binary.sh` 221 lines ยท 4404 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='combined and merge diff handle binary files and textconv' 4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main 5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 6 7 . ./test-lib.sh 8 9 test_expect_success 'setup binary merge conflict' ' 10 echo oneQ1 | q_to_nul >binary && 11 git add binary && 12 git commit -m one && 13 echo twoQ2 | q_to_nul >binary && 14 git commit -a -m two && 15 two=$(git rev-parse --short HEAD:binary) && 16 git checkout -b branch-binary HEAD^ && 17 echo threeQ3 | q_to_nul >binary && 18 git commit -a -m three && 19 three=$(git rev-parse --short HEAD:binary) && 20 test_must_fail git merge main && 21 echo resolvedQhooray | q_to_nul >binary && 22 git commit -a -m resolved && 23 res=$(git rev-parse --short HEAD:binary) 24 ' 25 26 cat >expect <actual && 40 test_cmp expect actual 41 ' 42 43 cat >expect <actual && 52 test_cmp expect actual 53 ' 54 55 cat >expect <actual && 64 test_cmp expect actual 65 ' 66 67 test_expect_success 'setup non-binary with binary attribute' ' 68 git checkout main && 69 test_commit one text && 70 test_commit two text && 71 two=$(git rev-parse --short HEAD:text) && 72 git checkout -b branch-text HEAD^ && 73 test_commit three text && 74 three=$(git rev-parse --short HEAD:text) && 75 test_must_fail git merge main && 76 test_commit resolved text && 77 res=$(git rev-parse --short HEAD:text) && 78 echo text -diff >.gitattributes 79 ' 80 81 cat >expect <actual && 95 test_cmp expect actual 96 ' 97 98 cat >expect <actual && 107 test_cmp expect actual 108 ' 109 110 cat >expect <actual && 119 test_cmp expect actual 120 ' 121 122 test_expect_success 'setup textconv attribute' ' 123 echo "text diff=upcase" >.gitattributes && 124 git config diff.upcase.textconv "tr a-z A-Z <" 125 ' 126 127 cat >expect <actual && 149 test_cmp expect actual 150 ' 151 152 cat >expect <actual && 166 test_cmp expect actual 167 ' 168 169 cat >expect <actual && 183 test_cmp expect actual 184 ' 185 186 cat >expect <full && 198 tail -n +2 full >actual && 199 test_cmp expect actual 200 ' 201 202 cat >expect <>>>>>> MAIN 213 EOF 214 test_expect_success 'diff --cc respects textconv on worktree file' ' 215 git reset --hard HEAD^ && 216 test_must_fail git merge main && 217 git diff >actual && 218 test_cmp expect actual 219 ' 220 221 test_done