3 # Copyright (c) 2009, Red Hat Inc, Author: Michael S. Tsirkin (mst@redhat.com)
6 test_description='test clone --reference'
11 test_expect_success 'preparing first repository' '
17 git commit -m A-initial
21 test_expect_success 'preparing second repository' '
27 git commit -m B-addition &&
33 test_expect_success 'preparing superproject' '
34 test_create_repo super &&
39 git commit -m B-super-initial
43 test_expect_success 'submodule add --reference' '
46 git submodule add --reference ../B "file://$base_dir/A" sub &&
47 git commit -m B-super-added
51 test_expect_success 'after add: existence of info/alternates' '
52 test_line_count = 1 super/.git/modules/sub/objects/info/alternates
55 test_expect_success 'that reference gets used with add' '
58 echo "0 objects, 0 kilobytes" >expected &&
59 git count-objects >current &&
64 test_expect_success 'cloning superproject' '
65 git clone super super-clone
68 test_expect_success 'update with reference' '
69 cd super-clone && git submodule update --init --reference ../B
72 test_expect_success 'after update: existence of info/alternates' '
73 test_line_count = 1 super-clone/.git/modules/sub/objects/info/alternates
76 test_expect_success 'that reference gets used with update' '
78 echo "0 objects, 0 kilobytes" >expected &&
79 git count-objects >current &&