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>
Clemens Buchacher committed
Jun 17, 2009 at 15:38 UTC
3eb9699733355d27fd5442492d66ec3c759e0c8b
1 file changed
+1
-1
remote.c
+1
-1
@@ -1254,7 +1254,7 @@ struct ref *get_remote_ref(const struct ref *remote_refs, const char *name)
1254
1255
static struct ref *get_local_ref(const char *name)
1256
{
1257
- if (!name)
1257
+ if (!name || name[0] == '\0')
1258
return NULL;
1259
1260
if (!prefixcmp(name, "refs/"))