Re: [PATCH 2/5] refs.c: write updates to packed refs when a transaction has more than one ref

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

 



Ronnie Sahlberg <sahlberg@xxxxxxxxxx> writes:

> +	/*
> +	 * Always copy loose refs that are to be deleted to the packed refs.
> +	 * If we are updating multiple refs then copy all non symref refs
> +	 * to the packed refs too.
> +	 */
>  	for (i = 0; i < n; i++) {
>  		struct ref_update *update = updates[i];
>  		unsigned char sha1[20];
> +		int flag;
>  
>  		if (update->update_type != UPDATE_SHA1)
>  			continue;
> -		if (!is_null_sha1(update->new_sha1))
> +		if (num_updates < 2 && !is_null_sha1(update->new_sha1))
>  			continue;
>  		if (get_packed_ref(update->refname))
>  			continue;
>  		if (!resolve_ref_unsafe(update->refname, sha1,
> -					RESOLVE_REF_READING, NULL))
> +					RESOLVE_REF_READING, &flag))
> +			continue;
> +		if (flag & REF_ISSYMREF)
>  			continue;

This skipping of symref didn't use to be here.

Is this an enhancement needed to implement the new "feature"
(i.e. use packed refs to represent multi-update as an atomic
operation)?  It looks to me more like an unrelated "oops, forgot
that we cannot use packed refs to store symrefs" fix-up, unless no
caller passed symref in updates[] in the original code, and now we
have callers that do.

Puzzled...
--
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]