The manual page says:
Git supports dividing the refs of a single repository into multiple namespaces, each of which has its own branches, tags, and
HEAD.
Here, the mention of HEAD implies that requiring all
namespaced to start with
refs/namespaces/*/refs
is too strict, as there are legal namespaced refs such as
refs/namespaces/*/HEAD
which are not captured. Relax the corresponding condition, change documentation and add a test to avoid regression.
The manual page says:
Git supports dividing the refs of a single repository into multiple namespaces, each of which has its own branches, tags, and
HEAD.
Here, the mention of HEAD implies that requiring all
namespaced to start with
refs/namespaces/*/refs
is too strict, as there are legal namespaced refs such as
refs/namespaces/*/HEAD
which are not captured. Relax the corresponding condition, change documentation and add a test to avoid regression.
REVIEW: update the example
In the commit message it said that we should be allowing
refs/namespaces/xyz/HEAD, but in this example it used refs/HEAD.
REVIEW: match for refs or HEAD
Instead of allowing any component, we limit to either refs or HEAD.
Maybe we can be more relaxed here, but my thinking is that since we
were strict before and want to allow for HEAD – as per the docs –
then we just relax that and only that check.
Only allow HEAD as suggested by Fintan.