On Sat, Jul 30, 2022 at 12:53 PM Linus Torvalds wrote: > > And "git symbolic-ref" is perfectly happy to take complete garbage > input. There seems to be no advantage over using that silly "echo" > model. Side note: it looks like that patch may break a test. And that test most definitely *should* be broken. t3200-branch.sh does git symbolic-ref refs/heads/dangling-symref nowhere which really depends on that whole "git symbolic-ref does no sanity checking at all". In fact, it seems to depend particularly on the fact that for non-HEAD refs, it does even *less* sanity checking, and doesn't even check that the ref starts with a "refs/" There is also t4202-log, which wants to test that "git log" reacts well to a bad ref. But now that "git symbolic-ref" refuses to create such a bad ref, that test fails. Anyway, here's a slightly updated patch that just fixes that test that depended on not just a dangling symref, but an *invalid* dangling symref. And it changes t4202-log to use "echo" to create the bad ref instead. Which is what the previous test did too, to create the bogus hash. Again - this is such a low-level plumbing thing that maybe nobody cares, but it just struck me as a bad idea to have these kinds of maintenance commands that can be used to just mess up your repository. And if you have a bare repo, this really does look like the command that *should* be used to change HEAD, since it's not about "git checkout" Linus