Re: [PATCH 40/44] packfile: allow prepare_packed_git to handle arbitrary repositories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brandon Williams <bmwill@xxxxxxxxxx> writes:

> On 03/03, Nguyễn Thái Ngọc Duy wrote:
>> From: Stefan Beller <sbeller@xxxxxxxxxx>
>> 
>> Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
>> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
>> ---
>
> This is an invalid conversion.
>
>>  packfile.c | 18 +++++++++---------
>>  packfile.h |  3 +--
>>  2 files changed, 10 insertions(+), 11 deletions(-)
>> 
>> diff --git a/packfile.c b/packfile.c
>> index 52febba932..2276e2ad26 100644
>> --- a/packfile.c
>> +++ b/packfile.c
>> @@ -882,19 +882,19 @@ static void prepare_packed_git_mru(struct repository *r)
>>  		list_add_tail(&p->mru, &r->objects.packed_git_mru);
>>  }
>>  
>> -void prepare_packed_git_the_repository(void)
>> +void prepare_packed_git(struct repository *r)
>>  {
>>  	struct alternate_object_database *alt;
>>  
>> -	if (the_repository->objects.packed_git_initialized)
>> +	if (r->objects.packed_git_initialized)
>>  		return;
>> -	prepare_packed_git_one(the_repository, get_object_directory(), 1);
>> -	prepare_alt_odb(the_repository);
>> -	for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next)
>> -		prepare_packed_git_one(the_repository, alt->path, 0);
>> -	rearrange_packed_git(the_repository);
>> -	prepare_packed_git_mru(the_repository);
>> -	the_repository->objects.packed_git_initialized = 1;
>> +	prepare_packed_git_one(r, get_object_directory(), 1);
>
> Calling get_object_directory() returns the_repository's object dir,
> this needs to be replaced with r->objects.objectdir.

Nicely spotted.  I think this was inherited from the orginal,
e.g. the one from the end of last month

https://public-inbox.org/git/20180228010608.215505-9-sbeller@xxxxxxxxxx/

also calls get_object_directory().

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux