Re: [PATCH v3 5/6] transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
- From
Jeff King <peff@peff.net>
- Date
- Jan 5, 2010, 06:32 UTC
- Message-ID
- <20100105063253.GA19368@coredump.intra.peff.net>
- In-Reply-To
- <20091224154445.ad4b7a01.rctay89@gmail.com>
On Thu, Dec 24, 2009 at 03:44:45PM +0800, Tay Ray Chuan wrote:
Show 14 quoted lines
> - ref->status = status;
> - ref->remote_status = msg;
> + switch (ref->status) {
> + case REF_STATUS_REJECT_NONFASTFORWARD:
> + case REF_STATUS_UPTODATE:
> + /*
> + * Earlier, the ref was marked not to be pushed, so ignore what
> + * the remote helper said about the ref.
> + */
> + continue;
> + default:
> + ref->status = status;
> + ref->remote_status = msg;
> + }It seems like this should be checking for REF_STATUS_NONE explicitly instead of trying to enumerate the reasons we might not have tried to push. Shouldn't helpers _only_ be pushing REF_STATUS_NONE refs?
I think right now the two cases are equivalent, since non-ff and uptodate are the only two states set before the helper is invoked. But we have discussed in the past (and I still have a patch floating around for) a REF_STATUS_REWIND which would treat strict rewinds differently (silently ignoring them instead of making an error). Explicitly checking REF_STATUS_NONE future-proofs against new states being added.
-Peff