On Mon, Feb 09, 2009 at 01:09:23AM -0800, Junio C Hamano wrote:
If you prune from the remote "frotz" that deleted the ref your tracking
branch remotes/frotz/HEAD points at, the symbolic ref will become
dangling. We used to detect this as an error condition and issued a
message every time refs are enumerated.
This stops the error message, but moves the warning to "remote prune".
Very nice. As a bonus, this fixes certain (admittedly unlikely) renames,
too (which don't need to pass the BROKEN flag, since ref_rename uses
get_loose_refs directly):
# without this patch
$ git symbolic-ref refs/heads/foo/bar refs/heads/nonexistant
$ git branch -m master foo
error: refs/heads/foo/bar points nowhere!
error: there are still refs under 'refs/heads/foo'
error: unable to lock refs/heads/foo for update
fatal: Branch rename failed
# with this patch
$ git branch -m master foo
error: 'refs/heads/foo/bar' exists; cannot create 'refs/heads/foo'
fatal: Branch rename failed
-Peff