Subject: Re: BUG when trying to delete symbolic refs

From: René Scharfe <[email-masked]>
Date: Thu, 18 Oct 2012 13:59:07 +0200

Am 16.10.2012 18:09, schrieb Junio C Hamano:
> Having said all that, I think your patch is going in the right
> direction.  If somebody had a symbolic ref in refs/heads/, the
> removal should remove it, not the pointee, which may not even
> exist.  Does "branch -d sym" work correctly with your patch when
> refs/heads/sym is pointing at something that does not exist?

No, it doesn't, neither with nor without the patch.  But we can make it
work, and also address a UI issue.  This series starts with two patches
that only move code around, then follows the patch you commented on, a
patch addressing dangling symrefs and finally a change to the way
deleted symrefs are reported by git branch.

  branch: factor out check_branch_commit()
  branch: factor out delete_branch_config()
  branch: delete symref branch, not its target
  branch: skip commit checks when deleting symref branches
  branch: show targets of deleted symrefs, not sha1s

 builtin/branch.c  | 75 ++++++++++++++++++++++++++++++++++++-------------------
 t/t3200-branch.sh | 19 ++++++++++++++
 2 files changed, 68 insertions(+), 26 deletions(-)

-- 
1.7.12