git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Heemskerk <mheemskerk@atlassian.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] upload-pack: ignore 'shallow' lines with unknown obj-ids
Date: Thu, 02 May 2013 10:05:13 -0700	[thread overview]
Message-ID: <7vehdp1fee.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vk3nh1fwx.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 02 May 2013 09:54:06 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Michael Heemskerk <mheemskerk@atlassian.com> writes:
>
>> When the client sends a 'shallow' line for an object that the server does
>> not have, the server currently dies with the error: "did not find object
>> ...
>>  Documentation/technical/pack-protocol.txt |  3 +--
>>  t/t5500-fetch-pack.sh                     | 13 +++++++++++++
>>  upload-pack.c                             |  2 +-
>>  3 files changed, 15 insertions(+), 3 deletions(-)
>
> Thanks.
>
> The previous one (without the test) is already in 'next' so I'll
> pick only the test part and queue it as an update to the series.
>
>> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
>> index d574085..3f0ca10 100755
>> --- a/t/t5500-fetch-pack.sh
>> +++ b/t/t5500-fetch-pack.sh
>> @@ -373,6 +373,19 @@ test_expect_success 'clone shallow with packed refs' '
>>  	test_cmp count8.expected count8.actual
>>  '
>>  
>> +test_expect_success 'fetch in shallow repo unreachable shallow objects' '
>> +	(
>> +		git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&
>> +		git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&
>> +		cd no-reflog &&
>> +		git tag -d TAGB1 TAGB2 &&
>> +		git update-ref refs/heads/B B~~ &&
>> +		git gc --prune=now &&
>> +		cd ../shallow9 &&
>> +		git fetch origin
>> +	)
>> +'

It would also be good to make sure that shallow9 does not lose the
shallow history boundary that the origin does not know about after
this fetch, so I'll further squash this in.

 t/t5500-fetch-pack.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 3f0ca10..6133d9e 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -382,7 +382,8 @@ test_expect_success 'fetch in shallow repo unreachable shallow objects' '
 		git update-ref refs/heads/B B~~ &&
 		git gc --prune=now &&
 		cd ../shallow9 &&
-		git fetch origin
+		git fetch origin &&
+		git fsck --no-dangling
 	)
 '
 

      reply	other threads:[~2013-05-02 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 14:56 [PATCH v2] upload-pack: ignore 'shallow' lines with unknown obj-ids Michael Heemskerk
2013-05-02 16:54 ` Junio C Hamano
2013-05-02 17:05   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vehdp1fee.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mheemskerk@atlassian.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).