aboutsummaryrefslogtreecommitdiff
path: root/builtin-remote.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-03-08 23:40:42 +0100
committerJunio C Hamano <gitster@pobox.com>2008-03-08 21:30:22 -0800
commit3b9dcff5df97ab642de48bc1ce781961686081aa (patch)
treea539a42e510a5edba6fba57b073219b964b1aaff /builtin-remote.c
parent84521ed6f2ccfd8dfe001806f83bb28e6a8934be (diff)
downloadgit-3b9dcff5df97ab642de48bc1ce781961686081aa.tar.gz
git-3b9dcff5df97ab642de48bc1ce781961686081aa.tar.xz
builtin remote rm: remove symbolic refs, too
"git remote add" can add a symbolic ref "HEAD", and "rm" should delete it, too. Noticed by Teemu Likonen. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-remote.c')
-rw-r--r--builtin-remote.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-remote.c b/builtin-remote.c
index ca3bf265a..637b90425 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -264,6 +264,11 @@ static int add_branch_for_removal(const char *refname,
if (!prefixcmp(refname, branches->prefix)) {
struct path_list_item *item;
+
+ /* make sure that symrefs are deleted */
+ if (flags & REF_ISSYMREF)
+ return unlink(git_path(refname));
+
item = path_list_append(refname, branches->branches);
item->util = xmalloc(20);
hashcpy(item->util, sha1);