path: root/t/
diff options
authorJohan Herland <>2008-05-22 22:03:05 (GMT)
committerJunio C Hamano <>2008-05-23 06:35:09 (GMT)
commitfabb01996be9f7c8862ab1a6fdfd83c90be5324a (patch)
tree80238af735b0861b2042af4a50654ed3b76daa2d /t/
parent4ba776c231f27e69435d76bac98d033db859cd6f (diff)
Add a test for another combination of --reference
In this case, the reference repository has some useful loose objects, but not all useful objects, and we make sure that we can find the objects we fetch from the repository we're cloning in the new repository, instead of potentially being distracted by the reference repository. Doing the wrong thing in a builtin-clone implementation would lead to this looking for an object in the wrong place, not finding it (because it's only in the right place), and crashing. Signed-off-by: Johan Herland <> Signed-off-by: Daniel Barkalow <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 21 insertions, 0 deletions
diff --git a/t/ b/t/
index 58a97f1..b53c3ff 100755
--- a/t/
+++ b/t/
@@ -120,4 +120,25 @@ 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"