Jeff King [off-list ref] writes:
Here it is, on top of mg/branch-list. The "test without -f" bits could
actually be squashed in to your commits if we really want clean history,
but I don't think it's a big deal.
Thanks.
In the longer term, we might want to update these tests further so that
they do not fail when implementation is updated not to write loose refs,
e.g.
test_expect_success \
'git branch abc should create a branch' \
- 'git branch abc && test -f .git/refs/heads/abc'
+ 'git branch abc && test_path_is_file .git/refs/heads/abc'
git branch abc && git show-ref -q --verify refs/heads/abc
But this patch is about correctness first, so I'll queue it as-is.