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>
This commit is contained in:

committed by
Junio C Hamano

parent
50a991ec46
commit
3eb9699733
2
remote.c
2
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)
|
static struct ref *get_local_ref(const char *name)
|
||||||
{
|
{
|
||||||
if (!name)
|
if (!name || name[0] == '\0')
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!prefixcmp(name, "refs/"))
|
if (!prefixcmp(name, "refs/"))
|
||||||
|
Reference in New Issue
Block a user