return 1;
}
return ref_transaction_update(transaction, refname, new_oid,
- null_oid(the_hash_algo), new_target, NULL, flags,
+ null_oid(transaction->ref_store->repo->hash_algo), new_target, NULL, flags,
msg, err);
}
if (old_target && !(flags & REF_NO_DEREF))
BUG("delete cannot operate on symrefs with deref mode");
return ref_transaction_update(transaction, refname,
- null_oid(the_hash_algo), old_oid,
+ null_oid(transaction->ref_store->repo->hash_algo), old_oid,
NULL, old_target, flags,
msg, err);
}
subrepo = xmalloc(sizeof(*subrepo));
if (repo_submodule_init(subrepo, repo, submodule,
- null_oid(the_hash_algo))) {
+ null_oid(repo->hash_algo))) {
free(subrepo);
goto done;
}
strbuf_reset(buf);
if (!(update->flags & REF_HAVE_OLD))
- strbuf_addf(buf, "%s ", oid_to_hex(null_oid(the_hash_algo)));
+ strbuf_addf(buf, "%s ", oid_to_hex(null_oid(transaction->ref_store->repo->hash_algo)));
else if (update->old_target)
strbuf_addf(buf, "ref:%s ", update->old_target);
else
strbuf_addf(buf, "%s ", oid_to_hex(&update->old_oid));
if (!(update->flags & REF_HAVE_NEW))
- strbuf_addf(buf, "%s ", oid_to_hex(null_oid(the_hash_algo)));
+ strbuf_addf(buf, "%s ", oid_to_hex(null_oid(transaction->ref_store->repo->hash_algo)));
else if (update->new_target)
strbuf_addf(buf, "ref:%s ", update->new_target);
else
static int migrate_one_ref(const struct reference *ref, void *cb_data)
{
struct migration_data *data = cb_data;
+ const struct git_hash_algo *hash_algo = data->transaction->ref_store->repo->hash_algo;
struct strbuf symref_target = STRBUF_INIT;
int ret;
if (ret < 0)
goto done;
- ret = ref_transaction_update(data->transaction, ref->name, NULL, null_oid(the_hash_algo),
+ ret = ref_transaction_update(data->transaction, ref->name, NULL, null_oid(hash_algo),
symref_target.buf, NULL,
REF_SKIP_CREATE_REFLOG | REF_NO_DEREF, NULL, data->errbuf);
if (ret < 0)