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/lib-diff.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 / lib-diff.sh` 41 lines ยท 1395 bytes Raw Blame History 1 . "$TEST_DIRECTORY"/lib-diff-data.sh 2 3 : 4 5 sanitize_diff_raw='/^:/s/ '"\($OID_REGEX\)"' '"\($OID_REGEX\)"' \([A-Z]\)[0-9]* / \1 \2 \3# /' 6 compare_diff_raw () { 7 # When heuristics are improved, the score numbers would change. 8 # Ignore them while comparing. 9 # Also we do not check SHA1 hash generation in this test, which 10 # is a job for t0000-basic.sh 11 12 sed -e "$sanitize_diff_raw" <"$1" >.tmp-1 13 sed -e "$sanitize_diff_raw" <"$2" >.tmp-2 14 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 15 } 16 17 sanitize_diff_raw_z='/^:/s/ '"$OID_REGEX"' '"$OID_REGEX"' \([A-Z]\)[0-9]*$/ X X \1#/' 18 compare_diff_raw_z () { 19 # When heuristics are improved, the score numbers would change. 20 # Ignore them while comparing. 21 # Also we do not check SHA1 hash generation in this test, which 22 # is a job for t0000-basic.sh 23 24 tr "\000" "\012" <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1 25 tr "\000" "\012" <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2 26 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 27 } 28 29 compare_diff_patch () { 30 # When heuristics are improved, the score numbers would change. 31 # Ignore them while comparing. 32 sed -e ' 33 /^[dis]*imilarity index [0-9]*%$/d 34 /^index [0-9a-f]*\.\.[0-9a-f]/d 35 ' <"$1" >.tmp-1 36 sed -e ' 37 /^[dis]*imilarity index [0-9]*%$/d 38 /^index [0-9a-f]*\.\.[0-9a-f]/d 39 ' <"$2" >.tmp-2 40 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 41 }