2007-08-17 18:56:54 +02: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 &&
|
2010-10-31 02:46:54 +01:00
|
|
|
git add subfile &&
|
2007-08-17 18:56:54 +02:00
|
|
|
git commit -m "subproject commit #1"
|
|
|
|
) &&
|
2010-10-31 02:46:54 +01:00
|
|
|
>mainfile &&
|
2007-08-17 18:56:54 +02:00
|
|
|
git add sub mainfile &&
|
|
|
|
test_tick &&
|
|
|
|
git commit -m "superproject commit #1"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success clone '
|
2008-05-04 07:37:59 +02:00
|
|
|
git clone "file://$(pwd)/.git" cloned &&
|
2007-08-17 18:56:54 +02:00
|
|
|
(git rev-parse HEAD; git ls-files -s) >expected &&
|
|
|
|
(
|
|
|
|
cd cloned &&
|
|
|
|
(git rev-parse HEAD; git ls-files -s) >../actual
|
|
|
|
) &&
|
2008-03-12 22:36:36 +01:00
|
|
|
test_cmp expected actual
|
2007-08-17 18:56:54 +02: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-12 22:36:36 +01:00
|
|
|
test_cmp expected actual
|
2007-08-17 18:56:54 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|