Skip to content

Commit 3eb9699

Browse files
Clemens Buchachergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 50a991e commit 3eb9699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ struct ref *get_remote_ref(const struct ref *remote_refs, const char *name)
12541254

12551255
static struct ref *get_local_ref(const char *name)
12561256
{
1257-
if (!name)
1257+
if (!name || name[0] == '\0')
12581258
return NULL;
12591259

12601260
if (!prefixcmp(name, "refs/"))

0 commit comments

Comments
 (0)