3 # Copyright (C) 2006 Martin Waitz <tali@admingilde.org>
6 test_description
='test clone --reference'
11 test_expect_success
'preparing first repository' \
12 'test_create_repo A && cd A &&
15 git commit -m initial'
19 test_expect_success
'preparing second repository' \
20 'git clone A B && cd B &&
21 echo second > file2 &&
23 git commit -m addition &&
29 test_expect_success
'cloning with reference' \
30 'git clone -l -s --reference B A C'
34 test_expect_success
'existance of info/alternates' \
35 'test `wc -l <C/.git/objects/info/alternates` = 2'
39 test_expect_success
'pulling from reference' \
45 test_expect_success
'that reference gets used' \
47 echo "0 objects, 0 kilobytes" > expected &&
48 git count-objects > current &&
49 diff expected current'
53 test_expect_success
'updating origin' \
57 git commit -m update &&
63 test_expect_success
'pulling changes from origin' \
69 # the 2 local objects are commit and tree from the merge
70 test_expect_success
'that alternate to origin gets used' \
72 echo "2 objects" > expected &&
73 git count-objects | cut -d, -f1 > current &&
74 diff expected current'