summaryrefslogtreecommitdiff
path: root/t/t5700-clone-reference.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-05-25 13:38:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-05-25 13:41:37 -0700
commitb84c343c885b8168047b2773b5c597d04337d9bd (patch)
treea4ef0ee1fd0939d2a465d794ba0d88fc54234d28 /t/t5700-clone-reference.sh
parentMerge branch 'jc/apply-whitespace' (diff)
parentAdd test for cloning with "--reference" repo being a subset of source repo (diff)
downloadtgif-b84c343c885b8168047b2773b5c597d04337d9bd.tar.xz
Merge branch 'db/clone-in-c'
* db/clone-in-c: Add test for cloning with "--reference" repo being a subset of source repo Add a test for another combination of --reference Test that --reference actually suppresses fetching referenced objects clone: fall back to copying if hardlinking fails builtin-clone.c: Need to closedir() in copy_or_link_directory() builtin-clone: fix initial checkout Build in clone Provide API access to init_db() Add a function to set a non-default work tree Allow for having for_each_ref() list extra refs Have a constant extern refspec for "--tags" Add a library function to add an alternate to the alternates file Add a lockfile function to append to a file Mark the list of refs to fetch as const Conflicts: cache.h t/t5700-clone-reference.sh
Diffstat (limited to 't/t5700-clone-reference.sh')
-rwxr-xr-xt/t5700-clone-reference.sh35
1 files changed, 34 insertions, 1 deletions
diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh
index e5619a9f5c..e1ca7303ac 100755
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -8,6 +8,8 @@ test_description='test clone --reference'
base_dir=`pwd`
+U=$base_dir/UPLOAD_LOG
+
test_expect_success 'preparing first repository' \
'test_create_repo A && cd A &&
echo first > file1 &&
@@ -50,8 +52,13 @@ diff expected current'
cd "$base_dir"
+rm -f $U
+
test_expect_success 'cloning with reference (no -l -s)' \
-'git clone --reference B "file://$(pwd)/A" D'
+'GIT_DEBUG_SEND_PACK=3 git clone --reference B "file://$(pwd)/A" D 3>$U'
+
+test_expect_success 'fetched no objects' \
+'! grep "^want" $U'
cd "$base_dir"
@@ -113,4 +120,30 @@ diff expected current'
cd "$base_dir"
+test_expect_success 'preparing alternate repository #1' \
+'test_create_repo F && cd F &&
+echo first > file1 &&
+git add file1 &&
+git commit -m initial'
+
+cd "$base_dir"
+
+test_expect_success 'cloning alternate repo #2 and adding changes to repo #1' \
+'git clone F G && cd F &&
+echo second > file2 &&
+git add file2 &&
+git commit -m addition'
+
+cd "$base_dir"
+
+test_expect_success 'cloning alternate repo #1, using #2 as reference' \
+'git clone --reference G F H'
+
+cd "$base_dir"
+
+test_expect_success 'cloning with reference being subset of source (-l -s)' \
+'git clone -l -s --reference A B E'
+
+cd "$base_dir"
+
test_done