@matheusbsbs / matheus-bagliano / commits / fabb01996b
Fork 0

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 <johan@herland.net> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johan Herland committed May 22, 2008 at 18:03 UTC fabb01996be9f7c8862ab1a6fdfd83c90be5324a
1 file changed +21
t/t5700-clone-reference.sh
+21
@@ -120,4 +120,25 @@ diff expected current'
120
121 cd "$base_dir"
122
123 +test_expect_success 'preparing alternate repository #1' \
124 +'test_create_repo F && cd F &&
125 +echo first > file1 &&
126 +git add file1 &&
127 +git commit -m initial'
128 +
129 +cd "$base_dir"
130 +
131 +test_expect_success 'cloning alternate repo #2 and adding changes to repo #1' \
132 +'git clone F G && cd F &&
133 +echo second > file2 &&
134 +git add file2 &&
135 +git commit -m addition'
136 +
137 +cd "$base_dir"
138 +
139 +test_expect_success 'cloning alternate repo #1, using #2 as reference' \
140 +'git clone --reference G F H'
141 +
142 +cd "$base_dir"
143 +
144 test_done