| # Copyright (C) 2006 Martin Waitz <tali@admingilde.org> |
| test_description='test clone --reference' |
| test_expect_success 'preparing first repository' \ |
| 'test_create_repo A && cd A && |
| test_expect_success 'preparing second repository' \ |
| 'git clone A B && cd B && |
| git commit -m addition && |
| test_expect_success 'cloning with reference' \ |
| 'git clone -l -s --reference B A C' |
| test_expect_success 'existance of info/alternates' \ |
| 'test `wc -l <C/.git/objects/info/alternates` = 2' |
| test_expect_success 'pulling from reference' \ |
| test_expect_success 'that reference gets used' \ |
| echo "0 objects, 0 kilobytes" > expected && |
| git count-objects > current && |
| test_expect_success 'updating origin' \ |
| test_expect_success 'pulling changes from origin' \ |
| # the 2 local objects are commit and tree from the merge |
| test_expect_success 'that alternate to origin gets used' \ |
| echo "2 objects" > expected && |
| git count-objects | cut -d, -f1 > current && |