make alloc_ref_from_str() the new alloc_ref()

With all calls to alloc_ref() gone, we can remove it and then we're free
to give alloc_ref_from_str() the shorter name.  It's a much nicer
interface, as the callers always need to have a name string when they
allocate a ref anyway and don't need to calculate and pass its length+1
any more.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2008-10-18 10:44:18 +02:00
committed by Junio C Hamano
parent b0b44bc7b2
commit 59c69c0c65
7 changed files with 18 additions and 27 deletions

View File

@ -1780,7 +1780,7 @@ static void one_remote_ref(char *refname)
struct ref *ref;
struct object *obj;
ref = alloc_ref_from_str(refname);
ref = alloc_ref(refname);
if (http_fetch_ref(remote->url, ref) != 0) {
fprintf(stderr,
@ -1887,7 +1887,7 @@ static void add_remote_info_ref(struct remote_ls_ctx *ls)
char *ref_info;
struct ref *ref;
ref = alloc_ref_from_str(ls->dentry_name);
ref = alloc_ref(ls->dentry_name);
if (http_fetch_ref(remote->url, ref) != 0) {
fprintf(stderr,