aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2008-10-18 10:44:18 +0200
committerJunio C Hamano <gitster@pobox.com>2008-10-18 06:53:47 -0700
commit59c69c0c656ebce2f7ce870b4913512597a98390 (patch)
treef2bcd14377a483929861a09cf929286da0f1700a /transport.c
parentb0b44bc7b26c8c4b4221a377ce6ba174b843cb8d (diff)
downloadgit-59c69c0c656ebce2f7ce870b4913512597a98390.tar.gz
git-59c69c0c656ebce2f7ce870b4913512597a98390.tar.xz
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>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/transport.c b/transport.c
index 3d034759b..cfb73500e 100644
--- a/transport.c
+++ b/transport.c
@@ -75,7 +75,7 @@ static int read_loose_refs(struct strbuf *path, int name_offset,
if (fd < 0)
continue;
- next = alloc_ref_from_str(path->buf + name_offset);
+ next = alloc_ref(path->buf + name_offset);
if (read_in_full(fd, buffer, 40) != 40 ||
get_sha1_hex(buffer, next->old_sha1)) {
close(fd);
@@ -126,7 +126,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
(*list)->next->name)) > 0)
list = &(*list)->next;
if (!(*list)->next || cmp < 0) {
- struct ref *next = alloc_ref_from_str(buffer + 41);
+ struct ref *next = alloc_ref(buffer + 41);
buffer[40] = '\0';
if (get_sha1_hex(buffer, next->old_sha1)) {
warning ("invalid SHA-1: %s", buffer);
@@ -499,7 +499,7 @@ static struct ref *get_refs_via_curl(struct transport *transport)
strbuf_release(&buffer);
- ref = alloc_ref_from_str("HEAD");
+ ref = alloc_ref("HEAD");
if (!walker->fetch_ref(walker, ref) &&
!resolve_remote_symref(ref, refs)) {
ref->next = refs;
@@ -540,7 +540,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport)
die ("Could not read bundle '%s'.", transport->url);
for (i = 0; i < data->header.references.nr; i++) {
struct ref_list_entry *e = data->header.references.list + i;
- struct ref *ref = alloc_ref_from_str(e->name);
+ struct ref *ref = alloc_ref(e->name);
hashcpy(ref->old_sha1, e->sha1);
ref->next = result;
result = ref;