Re: [PATCH 2/2] ref-filter: support filtering of operational refs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 3, 2024, 17:21 UTC
- Message-ID
- <xmqqil4a9vue.fsf@gitster.g>
- In-Reply-To
- <ZZWIlx-9D2r9AfDW@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
> ... But the problem is that tools like git-update-ref(1) don't > enforce this, so something like `git update-ref foo/bar HEAD` happily > creates "$GIT_DIR/foo/bar". And I bet there are other ways to write refs > at arbitrary paths.
I think we should tighten things up over time. First by teaching the ref backend that anything that is not a pseudoref, HEAD or a proper ref (one item of whose definition is "lives under refs/ hierarchy) should not resolve_ref() successfully. That should correctly fail things like
$ git rev-parse worktrees/$name/bisect/bad
$ git update-ref foo/bar HEADI'd hope.
Thanks.