summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:20 (GMT)
committerJeff King <peff@peff.net>2015-11-20 13:02:05 (GMT)
commitf4e54d02b894064d370e461385b48701485672bd (patch)
treec6e25d995009bbe422f87a2da72ed5d5b2098ced /transport-helper.c
parentb419aa25d5622268f515b26e76420eb2dd89e7e6 (diff)
downloadgit-f4e54d02b894064d370e461385b48701485672bd.zip
git-f4e54d02b894064d370e461385b48701485672bd.tar.gz
git-f4e54d02b894064d370e461385b48701485672bd.tar.bz2
Convert struct ref to use object_id.
Use struct object_id in three fields in struct ref and convert all the necessary places that use it. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 63d5427..91cb0e7 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -346,7 +346,7 @@ static int fetch_with_fetch(struct transport *transport,
continue;
strbuf_addf(&buf, "fetch %s %s\n",
- sha1_to_hex(posn->old_sha1),
+ oid_to_hex(&posn->old_oid),
posn->symref ? posn->symref : posn->name);
}
@@ -489,7 +489,7 @@ static int fetch_with_import(struct transport *transport,
else
private = xstrdup(name);
if (private) {
- if (read_ref(private, posn->old_sha1) < 0)
+ if (read_ref(private, posn->old_oid.hash) < 0)
die("Could not read ref %s", private);
free(private);
}
@@ -756,7 +756,7 @@ static int push_update_refs_status(struct helper_data *data,
private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
if (!private)
continue;
- update_ref("update by helper", private, ref->new_sha1, NULL, 0, 0);
+ update_ref("update by helper", private, ref->new_oid.hash, NULL, 0, 0);
free(private);
}
strbuf_release(&buf);
@@ -818,7 +818,7 @@ static int push_refs_with_push(struct transport *transport,
if (ref->peer_ref)
strbuf_addstr(&buf, ref->peer_ref->name);
else
- strbuf_addstr(&buf, sha1_to_hex(ref->new_sha1));
+ strbuf_addstr(&buf, oid_to_hex(&ref->new_oid));
}
strbuf_addch(&buf, ':');
strbuf_addstr(&buf, ref->name);
@@ -827,14 +827,14 @@ static int push_refs_with_push(struct transport *transport,
/*
* The "--force-with-lease" options without explicit
* values to expect have already been expanded into
- * the ref->old_sha1_expect[] field; we can ignore
+ * the ref->old_oid_expect[] field; we can ignore
* transport->smart_options->cas altogether and instead
* can enumerate them from the refs.
*/
if (ref->expect_old_sha1) {
struct strbuf cas = STRBUF_INIT;
strbuf_addf(&cas, "%s:%s",
- ref->name, sha1_to_hex(ref->old_sha1_expect));
+ ref->name, oid_to_hex(&ref->old_oid_expect));
string_list_append(&cas_options, strbuf_detach(&cas, NULL));
}
}
@@ -884,7 +884,7 @@ static int push_refs_with_export(struct transport *transport,
if (private && !get_sha1(private, sha1)) {
strbuf_addf(&buf, "^%s", private);
string_list_append(&revlist_args, strbuf_detach(&buf, NULL));
- hashcpy(ref->old_sha1, sha1);
+ hashcpy(ref->old_oid.hash, sha1);
}
free(private);
@@ -1016,12 +1016,12 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
if (buf.buf[0] == '@')
(*tail)->symref = xstrdup(buf.buf + 1);
else if (buf.buf[0] != '?')
- get_sha1_hex(buf.buf, (*tail)->old_sha1);
+ get_oid_hex(buf.buf, &(*tail)->old_oid);
if (eon) {
if (has_attribute(eon + 1, "unchanged")) {
(*tail)->status |= REF_STATUS_UPTODATE;
if (read_ref((*tail)->name,
- (*tail)->old_sha1) < 0)
+ (*tail)->old_oid.hash) < 0)
die(N_("Could not read ref %s"),
(*tail)->name);
}