1#!/bin/sh 2 3test_description='blob conversion via gitattributes' 4 5. ./test-lib.sh 6 7test_expect_success setup ' 8 { 9 echo "*.i ident" 10 } >.gitattributes && 11 12 { 13 echo a b c d e f g h i j k l m 14 echo n o p q r s t u v w x y z 15 echo '\''$ident$'\'' 16 } >test && 17 cat test >test.t && 18 cat test >test.o && 19 cat test >test.i && 20 git add test test.t test.i && 21 rm -f test test.t test.i && 22 git checkout -- test test.t test.i 23' 24 25script='s/^\$ident: \([0-9a-f]*\) \$/\1/p' 26 27test_expect_success check ' 28 29 cmp test.o test && 30 cmp test.o test.t && 31 32 # ident should be stripped in the repository 33 git diff --raw --exit-code :test :test.i && 34 id=$(git rev-parse --verify :test)&& 35 embedded=$(sed -ne "$script" test.i)&& 36 test "z$id" = "z$embedded" 37' 38 39test_done