Subject: Re: [PATCH] HEAD, ORIG_HEAD and FETCH_HEAD are really special.

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Sep 2007 13:39:43 -0700

Pierre Habouzit <[email-masked]> writes:

> I'd have added though that maybe update-ref should print a warning for
> the references that do not match the restriction Junio added. This could
> be done using the function Junio proposed un update_ref() in refs.c

I would even suggest making it into an error, even if we do not
error out on the reading side (being liberal when reading but
more strict when creating, that is).

That confused_ref() needs to be tightened further, by the way.
It is called only when we are considering to tack the user
string immediately below $GIT_DIR/ so the only valid cases are
(1) the string begins with "refs/", or (2) the string is all
uppercase (or underscore), especially without slash.  The one in
the proposed patch is not strict enough and does not enforce the
former.