diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-15 22:06:53 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 11:05:50 +0900 |
commit | 89f3bbdd3b1f46a5747aa5618b7742f7b3f2adef (patch) | |
tree | e8345a55653b4f286a86bde54f44244b4fcc2201 /refs/files-backend.c | |
parent | 6ee18216d8d9ca8f76b01282b36bdf590a64d8fc (diff) | |
download | git-89f3bbdd3b1f46a5747aa5618b7742f7b3f2adef.tar.gz |
refs: update ref transactions to use struct object_id
Update the ref transaction code to use struct object_id. Remove one
NULL pointer check which was previously inserted around a dereference;
since we now pass a pointer to struct object_id directly through, the
code we're calling handles this for us.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
-rw-r--r-- | refs/files-backend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 9c4766aa57..8ab0a7ae04 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -994,7 +994,7 @@ static void prune_ref(struct files_ref_store *refs, struct ref_to_prune *r) transaction = ref_store_transaction_begin(&refs->base, &err); if (!transaction || - ref_transaction_delete(transaction, r->name, r->oid.hash, + ref_transaction_delete(transaction, r->name, &r->oid, REF_ISPRUNING | REF_NODEREF, NULL, &err) || ref_transaction_commit(transaction, &err)) { ref_transaction_free(transaction); @@ -1079,7 +1079,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags) * packed-refs transaction: */ if (ref_transaction_update(transaction, iter->refname, - iter->oid->hash, NULL, + iter->oid, NULL, REF_NODEREF, NULL, &err)) die("failure preparing to create packed reference %s: %s", iter->refname, err.buf); @@ -2148,7 +2148,7 @@ static int split_head_update(struct ref_update *update, new_update = ref_transaction_add_update( transaction, "HEAD", update->flags | REF_LOG_ONLY | REF_NODEREF, - update->new_oid.hash, update->old_oid.hash, + &update->new_oid, &update->old_oid, update->msg); /* @@ -2212,7 +2212,7 @@ static int split_symref_update(struct files_ref_store *refs, new_update = ref_transaction_add_update( transaction, referent, new_flags, - update->new_oid.hash, update->old_oid.hash, + &update->new_oid, &update->old_oid, update->msg); new_update->parent_update = update; @@ -2594,7 +2594,7 @@ static int files_transaction_prepare(struct ref_store *ref_store, ref_transaction_add_update( packed_transaction, update->refname, update->flags & ~REF_HAVE_OLD, - update->new_oid.hash, update->old_oid.hash, + &update->new_oid, &update->old_oid, NULL); } } @@ -2847,7 +2847,7 @@ static int files_initial_transaction_commit(struct ref_store *ref_store, */ ref_transaction_add_update(packed_transaction, update->refname, update->flags & ~REF_HAVE_OLD, - update->new_oid.hash, update->old_oid.hash, + &update->new_oid, &update->old_oid, NULL); } |