summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 84521ed)
raw | patch | inline | side by side (parent: 84521ed)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 8 Mar 2008 22:40:42 +0000 (23:40 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 9 Mar 2008 05:30:22 +0000 (21:30 -0800) |
"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>
it, too.
Noticed by Teemu Likonen.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | patch | blob | history | |
t/t5505-remote.sh | patch | blob | history |
diff --git a/builtin-remote.c b/builtin-remote.c
index ca3bf265a93ee457d0069f1379ead105a470745a..637b90425e1a9049ec9e9ebc2a3cf687616f6e79 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
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);
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index f45ea68f63e66ae43f7d8beee0cb96a98e46bc15..2822a651b5c434bb9243a6f8f9069a8fee1ad590 100755 (executable)
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
test_expect_success 'remove remote' '
(
cd test &&
+ git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master &&
git remote rm second
)
'