]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'hn/refs-iterator-peel-returns-boolean'
authorJunio C Hamano <gitster@pobox.com>
Sat, 17 Jul 2021 00:42:49 +0000 (17:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 17 Jul 2021 00:42:49 +0000 (17:42 -0700)
Tiny API tweak.

* hn/refs-iterator-peel-returns-boolean:
  refs: make explicit that ref_iterator_peel returns boolean

1  2 
refs.c

diff --combined refs.c
index 8c9490235ea6fa08013dda680f9eaeae8f356855,87cc64d5629925e3aede61a8b64cac6d8333e48e..8b9f7c3a80a0f615e33a7d14cd505c27c3304491
--- 1/refs.c
--- 2/refs.c
+++ b/refs.c
@@@ -337,7 -337,7 +337,7 @@@ static int filter_refs(const char *refn
  
  enum peel_status peel_object(const struct object_id *name, struct object_id *oid)
  {
 -      struct object *o = lookup_unknown_object(name);
 +      struct object *o = lookup_unknown_object(the_repository, name);
  
        if (o->type == OBJ_NONE) {
                int type = oid_object_info(the_repository, name, NULL);
@@@ -1107,7 -1107,7 +1107,7 @@@ int ref_transaction_create(struct ref_t
        if (!new_oid || is_null_oid(new_oid))
                BUG("create called without valid new_oid");
        return ref_transaction_update(transaction, refname, new_oid,
 -                                    &null_oid, flags, msg, err);
 +                                    null_oid(), flags, msg, err);
  }
  
  int ref_transaction_delete(struct ref_transaction *transaction,
        if (old_oid && is_null_oid(old_oid))
                BUG("delete called with old_oid set to zeros");
        return ref_transaction_update(transaction, refname,
 -                                    &null_oid, old_oid,
 +                                    null_oid(), old_oid,
                                      flags, msg, err);
  }
  
@@@ -2010,7 -2010,7 +2010,7 @@@ int peel_iterated_oid(const struct obje
             oideq(current_ref_iter->oid, base)))
                return ref_iterator_peel(current_ref_iter, peeled);
  
-       return peel_object(base, peeled);
+       return peel_object(base, peeled) ? -1 : 0;
  }
  
  int refs_create_symref(struct ref_store *refs,