# [PATCH] Add a test for another combination of --reference

3 messages from 2008-05-22 to 2008-05-23. Participants: Daniel Barkalow, Johan Herland.
Thread: https://gitlist.dev/t/13621

## Daniel Barkalow, 2008-05-22 22:03

Subject: [PATCH] Add a test for another combination of --reference
Message-ID: <alpine.LNX.1.00.0805221800090.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0805221800090.19665%40iabervon.org

```
From: Johan Herland <johan@herland.net>

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>
---
 t/t5700-clone-reference.sh |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh
index d318780..0c42d9f 100755
--- a/t/t5700-clone-reference.sh
+++ b/t/t5700-clone-reference.sh
@@ -118,4 +118,25 @@ test_expect_success 'cloning with reference being subset of source (-l -s)' \
 
 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
-- 
1.5.3.7

```

## Johan Herland, 2008-05-22 22:34

Subject: Re: [PATCH] Add a test for another combination of --reference
Message-ID: <200805230034.33567.johan@herland.net>
URL: https://gitlist.dev/e/200805230034.33567.johan%40herland.net
In-Reply-To: <alpine.LNX.1.00.0805221800090.19665@iabervon.org>

```
On Friday 23 May 2008, Daniel Barkalow wrote:
> From: Johan Herland <johan@herland.net>
> 
> 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>

Thanks again.

...Johan

PS: I'm holding off on submitting my builtin-clone-packs-refs series until
1.5.6 is out. I think builtin-clone has seen enough action in this cycle. :)

-- 
Johan Herland, <johan@herland.net>
www.herland.net

```

## Daniel Barkalow, 2008-05-23 02:03

Subject: Re: [PATCH] Add a test for another combination of --reference
Message-ID: <alpine.LNX.1.00.0805222202060.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0805222202060.19665%40iabervon.org
In-Reply-To: <200805230034.33567.johan@herland.net>

```
On Fri, 23 May 2008, Johan Herland wrote:

> On Friday 23 May 2008, Daniel Barkalow wrote:
> > From: Johan Herland <johan@herland.net>
> > 
> > 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>
> 
> Thanks again.
> 
> ...Johan
> 
> PS: I'm holding off on submitting my builtin-clone-packs-refs series until
> 1.5.6 is out. I think builtin-clone has seen enough action in this cycle. :)

Yeah, I agree.

	-Daniel
*This .sig left intentionally blank*

```
