3 test_description=git-hash-object
8 'git hash-object -w --stdin saves the object' \
9 'obname=$(echo foo | git hash-object -w --stdin) &&
10 obpath=$(echo $obname | sed -e "s/\(..\)/\1\//") &&
11 test -r .git/objects/"$obpath" &&
12 rm -f .git/objects/"$obpath"'
15 'git hash-object --stdin -w saves the object' \
16 'obname=$(echo foo | git hash-object --stdin -w) &&
17 obpath=$(echo $obname | sed -e "s/\(..\)/\1\//") &&
18 test -r .git/objects/"$obpath" &&
19 rm -f .git/objects/"$obpath"'
22 'git hash-object --stdin file1 <file0 first operates on file0, then file1' \
24 obname0=$(echo bar | git hash-object --stdin) &&
25 obname1=$(git hash-object file1) &&
26 obname0new=$(echo bar | git hash-object --stdin file1 | sed -n -e 1p) &&
27 obname1new=$(echo bar | git hash-object --stdin file1 | sed -n -e 2p) &&
28 test "$obname0" = "$obname0new" &&
29 test "$obname1" = "$obname1new"'
32 'git hash-object refuses multiple --stdin arguments' \
33 '! git hash-object --stdin --stdin < file1'