summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2009-06-17 13:38:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-18 16:55:34 (GMT)
commit3eb9699733355d27fd5442492d66ec3c759e0c8b (patch)
tree78046a0b4106182974d86ea25110009c4e231645 /remote.c
parent50a991ec46d57ffc4b7fbd0e8a13182dab3cd5de (diff)
downloadgit-3eb9699733355d27fd5442492d66ec3c759e0c8b.zip
git-3eb9699733355d27fd5442492d66ec3c759e0c8b.tar.gz
git-3eb9699733355d27fd5442492d66ec3c759e0c8b.tar.bz2
fetch: do not create ref from empty name
Previously, the refspec "<src>:" would be expanded to "<src>:refs/heads/". Instead, treat an empty <dst> just like refspecs without a colon. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index d66e2f3..39583d5 100644
--- a/remote.c
+++ b/remote.c
@@ -1254,7 +1254,7 @@ struct ref *get_remote_ref(const struct ref *remote_refs, const char *name)
static struct ref *get_local_ref(const char *name)
{
- if (!name)
+ if (!name || name[0] == '\0')
return NULL;
if (!prefixcmp(name, "refs/"))