Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] builtin remote rm: remove symbolic refs, too

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:21

Johannes Schindelin [off-list ref] writes:
quoted hunk
"git remote add" can add a symbolic ref "HEAD", and "rm" should delete
it, too.

Noticed by Teemu Likonen.

Signed-off-by: Johannes Schindelin <redacted>
---
 builtin-remote.c  |    5 +++++
 t/t5505-remote.sh |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c
index aa90cc9..f7653b6 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -267,6 +267,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));
+
Heh, doing this in C is much easier and simpler ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help