3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='Test pulling deltified objects
11 locate_obj
='s|\(..\)|.git/objects/\1/|'
16 git-update-cache --add a &&
17 a0=`git-ls-files --stage |
18 sed -e '\''s/^[0-7]* \([0-9a-f]*\) .*/\1/'\''` &&
20 sed -e 's
/test
/TEST
/g
' ../README >a &&
22 a1=`git-ls-files --stage |
23 sed -e '\''s/^[0-7]* \([0-9a-f]*\) .*/\1/'\''` &&
24 tree=`git-write-tree` &&
25 commit=`git-commit-tree $tree </dev/null` &&
26 a0f=`echo "$a0" | sed -e "$locate_obj"` &&
27 a1f=`echo "$a1" | sed -e "$locate_obj"` &&
28 echo commit $commit &&
32 echo $commit >.git/HEAD &&
33 git-mkdelta -v $a0 $a1 &&
36 # Now commit has a tree that records delitified "a" whose SHA1 is a1.
37 # Create a new repo and pull this commit into it.
40 'setup and cd into new repo' \
41 'mkdir dest && cd dest && rm -fr .git && git-init-db'
44 'pull from deltified repo into a new repo without -d' \
45 'rm -fr .git a && git-init-db &&
46 git-local-pull -v -a $commit ../.git/ &&
47 git-cat-file blob $a1 >a &&
51 'pull from deltified repo into a new repo with -d' \
52 'rm -fr .git a && git-init-db &&
53 git-local-pull -v -a -d $commit ../.git/ &&
54 git-cat-file blob $a1 >a &&
58 'pull from deltified repo after delta failure without --recover' \
60 git-local-pull -v -a $commit ../.git/ &&
61 git-cat-file blob $a1 >a &&
65 'pull from deltified repo after delta failure with --recover' \
67 git-local-pull -v -a --recover $commit ../.git/ &&
68 git-cat-file blob $a1 >a &&
72 'missing-tree or missing-blob should be re-fetched without --recover' \
74 git-local-pull -v -a $commit ../.git/ &&
75 git-cat-file blob $a1 >a &&