Skip to content

Commit

Permalink
fetch: do not create ref from empty name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Buchacher authored and Junio C Hamano committed Jun 18, 2009
1 parent 50a991e commit 3eb9699
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/"))
Expand Down

0 comments on commit 3eb9699

Please sign in to comment.