refs/files-backend: convert struct ref_to_prune to object_id
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 15 Oct 2017 22:06:49 +0000 (22:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Oct 2017 02:05:50 +0000 (11:05 +0900)
Change the member of this struct to be a struct object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
index 014dabb0bf3647b9392d6087ebf6c40e1bc68108..9db9237f1e37fa88ae28bfc0c2f55778895976fd 100644 (file)
@@ -926,7 +926,7 @@ static struct ref_lock *lock_ref_sha1_basic(struct files_ref_store *refs,
 
 struct ref_to_prune {
        struct ref_to_prune *next;
-       unsigned char sha1[20];
+       struct object_id oid;
        char name[FLEX_ARRAY];
 };
 
@@ -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->sha1,
+           ref_transaction_delete(transaction, r->name, r->oid.hash,
                                   REF_ISPRUNING | REF_NODEREF, NULL, &err) ||
            ref_transaction_commit(transaction, &err)) {
                ref_transaction_free(transaction);
@@ -1088,7 +1088,7 @@ static int files_pack_refs(struct ref_store *ref_store, unsigned int flags)
                if ((flags & PACK_REFS_PRUNE)) {
                        struct ref_to_prune *n;
                        FLEX_ALLOC_STR(n, name, iter->refname);
-                       hashcpy(n->sha1, iter->oid->hash);
+                       oidcpy(&n->oid, iter->oid);
                        n->next = refs_to_prune;
                        refs_to_prune = n;
                }