]> asedeno.scripts.mit.edu Git - git.git/blobdiff - http-push.c
Merge branch 'ds/branch-auto-rebase'
[git.git] / http-push.c
index 939a76460232f9097b20e43d71b35efbdad97b52..42727c8a45c7b50e8e6b2b04a0799c9ba85a0114 100644 (file)
@@ -1761,8 +1761,7 @@ static void one_remote_ref(char *refname)
        struct ref *ref;
        struct object *obj;
 
-       ref = alloc_ref(strlen(refname) + 1);
-       strcpy(ref->name, refname);
+       ref = alloc_ref_from_str(refname);
 
        if (http_fetch_ref(remote->url, ref) != 0) {
                fprintf(stderr,
@@ -1894,8 +1893,7 @@ static void add_remote_info_ref(struct remote_ls_ctx *ls)
        char *ref_info;
        struct ref *ref;
 
-       ref = alloc_ref(strlen(ls->dentry_name) + 1);
-       strcpy(ref->name, ls->dentry_name);
+       ref = alloc_ref_from_str(ls->dentry_name);
 
        if (http_fetch_ref(remote->url, ref) != 0) {
                fprintf(stderr,