Re: [PATCH] fetch/push: allow refs/*:refs/*

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> This combination "!memcmp(ref->name, "refs/", 5) &&
> check_refname_format(ref->name, 0)" is the reason that I suggested
> adding a REFNAME_FULL option [1], in which case it could be written
> "check_refname_format(ref->name, REFNAME_FULL)".

I personally think that check-refname-format should lose its second
parameter and always check for a concrete full refs, so that we can
tighten the current allow-onelevel case a bit further (i.e. ".git/HEAD" is
OK at the root level, but ".git/refs/heads/HEAD" is asking for trouble,
and ".git/config" is downright confusing. The function does not get a good
enough clue by only ONELEVEL).  That would mean REFNAME_FULL will not be
necessary---it should be the only mode of operation, and the callers need
to be adjusted accordingly.

We should also introduce another function check-refspec-half-format to be
used for the checks for left and right halves of refspec ("refs/heads/*"
is OK but "refs/heads*" is not, perhaps).

A single function trying to do both and not doing a good job in either
case is not a pretty picture.
--
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]