Skip to content

Commit

Permalink
Add a test for another combination of --reference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Herland authored and Junio C Hamano committed May 23, 2008
1 parent 4ba776c commit fabb019
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/t5700-clone-reference.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

test_done

0 comments on commit fabb019

Please sign in to comment.