3 # Copyright (C) 2006 Martin Waitz <tali@admingilde.org>
6 test_description='test transitive info/alternate entries'
9 # test that a file is not reachable in the current repository
10 # but that it is after creating a info/alternate entry
14 if git cat-file -e "HEAD:$file"; then return 1; fi
15 echo "$alternate" >> .git/objects/info/alternate
16 git cat-file -e "HEAD:$file"
20 git fsck-objects --full > fsck.log &&
21 test `wc -l < fsck.log` = 0
26 test_expect_success 'preparing first repository' \
27 'test_create_repo A && cd A &&
28 echo "Hello World" > file1 &&
30 git commit -m "Initial commit" file1 &&
36 test_expect_success 'preparing second repository' \
37 'git clone -l -s A B && cd B &&
38 echo "foo bar" > file2 &&
40 git commit -m "next commit" file2 &&
41 git repack -a -d -l &&
46 test_expect_success 'preparing third repository' \
47 'git clone -l -s B C && cd C &&
48 echo "Goodbye, cruel world" > file3 &&
50 git commit -m "one more" file3 &&
51 git repack -a -d -l &&
56 test_expect_failure 'creating too deep nesting' \
57 'git clone -l -s C D &&
58 git clone -l -s D E &&
59 git clone -l -s E F &&
60 git clone -l -s F G &&
65 test_expect_success 'validity of third repository' \
71 test_expect_success 'validity of fourth repository' \
77 test_expect_success 'breaking of loops' \
78 "echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&
84 test_expect_failure 'that info/alternates is necessary' \
86 rm .git/objects/info/alternates &&
91 test_expect_success 'that relative alternate is possible for current dir' \
93 echo "../../../B/.git/objects" > .git/objects/info/alternates &&
98 test_expect_failure 'that relative alternate is only possible for current dir' \