[PATCH 0/2] Fixes for git branch -m / update-ref --no-deref -d

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Miklos Vajna
Date: Saturday, October 25, 2008 - 5:58 am

On Fri, Oct 24, 2008 at 04:33:28PM -0700, Junio C Hamano <gitster@pobox.com> wrote:

While trying to answer your question, I noticed that
rename_ref()/delete_ref() did not really handled symrefs.

Regarding rename_ref() (for users: git branch -m) I think you can't
create symrefs in the refs/heads namespace without using plumbing, so
most users are not affected.

Regarding delete_ref() (for users: git update-ref --no-deref -d) in most
repos you just have HEAD as symref and you never want to delete it, but
in case the user asks for it, I think we just have to do so.

Here are two patches to fix these issues (and in fact they will be
required for git remote rename as well).

Miklos Vajna (2):
  Fix git branch -m for symrefs.
  Fix git update-ref --no-deref -d.

 builtin-branch.c       |    2 +-
 builtin-receive-pack.c |    2 +-
 builtin-remote.c       |    4 +-
 builtin-reset.c        |    2 +-
 builtin-send-pack.c    |    2 +-
 builtin-tag.c          |    2 +-
 builtin-update-ref.c   |    8 ++++--
 cache.h                |    2 +-
 refs.c                 |   56 ++++++++++++++++++++++++++++++------------------
 t/t1400-update-ref.sh  |    7 ++++++
 t/t3200-branch.sh      |    9 +++++++
 11 files changed, 64 insertions(+), 32 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Implement git remote mv, Miklos Vajna, (Tue Oct 21, 5:23 pm)
Re: [PATCH] Implement git remote mv, Brandon Casey, (Wed Oct 22, 9:52 am)
[PATCH] Implement git remote mv, Miklos Vajna, (Wed Oct 22, 6:18 pm)
Re: [PATCH] Implement git remote mv, Jeff King, (Wed Oct 22, 8:52 pm)
[PATCH] Implement git remote rename, Miklos Vajna, (Thu Oct 23, 5:56 am)
Re: [PATCH] Implement git remote rename, Junio C Hamano, (Fri Oct 24, 4:33 pm)
[PATCH 0/2] Fixes for git branch -m / update-ref --no-deref -d, Miklos Vajna, (Sat Oct 25, 5:58 am)
[PATCH 1/2] Fix git branch -m for symrefs., Miklos Vajna, (Sat Oct 25, 5:58 am)
[PATCH 2/2] Fix git update-ref --no-deref -d., Miklos Vajna, (Sat Oct 25, 5:58 am)
Re: [PATCH 1/2] Fix git branch -m for symrefs., Junio C Hamano, (Sat Oct 25, 11:31 am)
[PATCH 0/3] symref rename/delete fixes, Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH 1/3] Fix git branch -m for symrefs., Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH 3/3] Fix git update-ref --no-deref -d., Miklos Vajna, (Sat Oct 25, 7:33 pm)
[PATCH] Implement git remote rename, Miklos Vajna, (Mon Nov 3, 11:26 am)
Re: [PATCH] Implement git remote rename, Miklos Vajna, (Mon Nov 10, 1:42 pm)