3 # Copyright (C) 2006 Martin Waitz <tali@admingilde.org>
6 test_description
='test transitive info/alternate entries'
11 test_expect_success
'preparing first repository' \
12 'test_create_repo A && cd A &&
13 echo "Hello World" > file1 &&
15 git commit -m "Initial commit" file1 &&
21 test_expect_success
'preparing second repository' \
22 'git clone -l -s A B && cd B &&
23 echo "foo bar" > file2 &&
25 git commit -m "next commit" file2 &&
26 git repack -a -d -l &&
31 test_expect_success
'preparing third repository' \
32 'git clone -l -s B C && cd C &&
33 echo "Goodbye, cruel world" > file3 &&
35 git commit -m "one more" file3 &&
36 git repack -a -d -l &&
41 test_expect_success
'creating too deep nesting' \
42 'git clone -l -s C D &&
43 git clone -l -s D E &&
44 git clone -l -s E F &&
45 git clone -l -s F G &&
46 git clone --bare -l -s G H'
48 test_expect_success
'invalidity of deepest repository' \
50 test_must_fail git fsck
55 test_expect_success
'validity of third repository' \
61 test_expect_success
'validity of fourth repository' \
67 test_expect_success
'breaking of loops' \
68 'echo "$base_dir"/B/.git/objects >> "$base_dir"/A/.git/objects/info/alternates&&
74 test_expect_success
'that info/alternates is necessary' \
76 rm -f .git/objects/info/alternates &&
77 test_must_fail git fsck
82 test_expect_success
'that relative alternate is possible for current dir' \
84 echo "../../../B/.git/objects" > .git/objects/info/alternates &&
90 'that relative alternate is only possible for current dir' '
92 test_must_fail git fsck