Re: [PATCH jn/fast-import-fix v3] fast-import: treat filemodify with empty tree as delete

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

 



Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

>> Hmm.  I suppose on top of b2124125 (jn/fast-import-fix).
>
> Hmm, why not on top of v1.7.3-rc0~75^2 aka 334fba6 (Teach fast-import to
> import subtrees named by tree id, 2010-06-30) then?

That could work, too. ;-)

I was too lazy to check if the test case happens to work in the
absence of the fixes from the fast-import-fix branch.

>> +++ b/fast-import.c
>> @@ -2194,6 +2194,16 @@ static void file_change_m(struct branch *b)
>>  		p = uq.buf;
>>  	}
>>  
>> +	/*
>> +	 * Git does not track empty, non-toplevel directories.
>> +	 */
>> +	if (S_ISDIR(mode) &&
>> +	    !memcmp(sha1, (const unsigned char *) EMPTY_TREE_SHA1_BIN, 20) &&
>
> Do you need this cast?

No, it's not needed.

(EMPTY_TREE_SHA1_BIN is a string constant, originally intended for
use in initializers like

	static const unsigned char empty_tree_sha1[20] = EMPTY_TREE_SHA1_BIN;

memcmp does not care about such considerations.)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]