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/helper/test-sha1.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 / helper / test-sha1.sh` 89 lines ยท 2116 bytes Raw Blame History 1 #!/bin/sh 2 3 dd if=/dev/zero bs=`1048576` count=100 2>/dev/null | 4 /usr/bin/time t/helper/test-tool sha1 >/dev/null 5 6 dd if=/dev/zero bs=`1048576` count=100 2>/dev/null | 7 /usr/bin/time t/helper/test-tool sha1-unsafe >/dev/null 8 9 while read expect cnt pfx 10 do 11 case "$expect" in '#'*) continue ;; esac 12 for sha1 in sha1 sha1-unsafe 13 do 14 actual=$( 15 { 16 test -z "$pfx" || echo "$pfx" 17 dd if=/dev/zero bs=`1048576` count=$cnt 2>/dev/null | 18 tr "\000" "g" 19 } | ./t/helper/test-tool $sha1 $cnt 20 ) 21 if test "$expect" = "$actual" 22 then 23 echo "OK ($sha1): $expect $cnt $pfx" 24 else 25 echo >&2 "OOPS ($sha1): $cnt" 26 echo >&2 "expect ($sha1): $expect" 27 echo >&2 "actual ($sha1): $actual" 28 exit 1 29 fi 30 done 31 done </dev/null | 64 tr "\000" "g" 65 } | sha1sum | 66 sed -e 's/ .*//' 67 ) 68 echo "$actual $cnt $pfx" 69 done <