Re: [PATCH 1/2] fetch/push: allow refs/*:refs/*
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 22, 2012, 16:56 UTC
- Message-ID
- <7vlih6ams7.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7v7gsrb1xs.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> ...
>> * The second branch of the if is *never* executed.
> else if (args.fetch_all &&
> (!args.depth || prefixcmp(ref->name, "refs/tags/") )) {
> *newtail = ref;
> ref->next = NULL;
> newtail = &ref->next;
> continue;
> }
>
> I am not familiar with (nor particularly interested in) the "args.depth"
> code, so I have no comment on this part offhand.This is "fetch --all" case. I think the original intent was to fetch all branches (hence exclusion of tags) so the prefixcmp() may not be correct (!prefixcmp() with "refs/heads" would be more kosher) these days. I am not sure what !args.depth check wants to do here (that is, I can see it wants to defeat "fetch --all" and instead make it go through the usual refspec matching codepath, but I do not know why we thought that is a good thing to do here).