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/t4105-apply-fuzz.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 / t4105-apply-fuzz.sh` 52 lines ยท 1124 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='apply with fuzz and offset' 4 5 6 . ./test-lib.sh 7 8 dotest () { 9 name="$1" && shift && 10 test_expect_success "$name" " 11 git checkout-index -f -q -u file && 12 git apply $* && 13 test_cmp expect file 14 " 15 } 16 17 test_expect_success setup ' 18 19 test_write_lines 1 2 3 4 5 6 7 8 9 10 11 12 >file && 20 git update-index --add file && 21 test_write_lines 1 2 3 4 5 6 7 a b c d e 8 9 10 11 12 >file && 22 cat file >expect && 23 git diff >O0.diff && 24 25 sed -e "s/@@ -5,6 +5,11 @@/@@ -2,6 +2,11 @@/" >O1.diff O0.diff && 26 sed -e "s/@@ -5,6 +5,11 @@/@@ -7,6 +7,11 @@/" >O2.diff O0.diff && 27 sed -e "s/@@ -5,6 +5,11 @@/@@ -19,6 +19,11 @@/" >O3.diff O0.diff && 28 29 sed -e "s/^ 5/ S/" >F0.diff O0.diff && 30 sed -e "s/^ 5/ S/" >F1.diff O1.diff && 31 sed -e "s/^ 5/ S/" >F2.diff O2.diff && 32 sed -e "s/^ 5/ S/" >F3.diff O3.diff 33 34 ' 35 36 dotest 'unmodified patch' O0.diff 37 38 dotest 'minus offset' O1.diff 39 40 dotest 'plus offset' O2.diff 41 42 dotest 'big offset' O3.diff 43 44 dotest 'fuzz with no offset' -C2 F0.diff 45 46 dotest 'fuzz with minus offset' -C2 F1.diff 47 48 dotest 'fuzz with plus offset' -C2 F2.diff 49 50 dotest 'fuzz with big offset' -C2 F3.diff 51 52 test_done