diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index 5301c3cb78..eeee0a5ebf 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -407,6 +407,8 @@ static int expand_refs_wildcard(const char *ls_remote_result, int numrefs, eol = !next ? (ls + strlen(ls)) : next; if (!memcmp("^{}", eol-3, 3)) continue; + if (eol - ls < 40) + continue; if (get_sha1_hex(ls, sha1)) continue; ls += 40;