2007-08-17 20:56:54 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='fetching and pushing project with subproject'
|
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success setup '
|
|
|
|
test_tick &&
|
|
|
|
mkdir -p sub && (
|
|
|
|
cd sub &&
|
|
|
|
git init &&
|
|
|
|
>subfile &&
|
|
|
|
git add subfile
|
|
|
|
git commit -m "subproject commit #1"
|
|
|
|
) &&
|
|
|
|
>mainfile
|
|
|
|
git add sub mainfile &&
|
|
|
|
test_tick &&
|
|
|
|
git commit -m "superproject commit #1"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success clone '
|
2008-05-04 09:37:59 +04:00
|
|
|
git clone "file://$(pwd)/.git" cloned &&
|
2007-08-17 20:56:54 +04:00
|
|
|
(git rev-parse HEAD; git ls-files -s) >expected &&
|
|
|
|
(
|
|
|
|
cd cloned &&
|
|
|
|
(git rev-parse HEAD; git ls-files -s) >../actual
|
|
|
|
) &&
|
2008-03-13 00:36:36 +03:00
|
|
|
test_cmp expected actual
|
2007-08-17 20:56:54 +04:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success advance '
|
|
|
|
echo more >mainfile &&
|
|
|
|
git update-index --force-remove sub &&
|
|
|
|
mv sub/.git sub/.git-disabled &&
|
|
|
|
git add sub/subfile mainfile &&
|
|
|
|
mv sub/.git-disabled sub/.git &&
|
|
|
|
test_tick &&
|
|
|
|
git commit -m "superproject commit #2"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success fetch '
|
|
|
|
(git rev-parse HEAD; git ls-files -s) >expected &&
|
|
|
|
(
|
|
|
|
cd cloned &&
|
|
|
|
git pull &&
|
|
|
|
(git rev-parse HEAD; git ls-files -s) >../actual
|
|
|
|
) &&
|
2008-03-13 00:36:36 +03:00
|
|
|
test_cmp expected actual
|
2007-08-17 20:56:54 +04:00
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|