pull: support pull.ff config
[gitweb.git] / builtin / reflog.c
index 8182b648b9c9693ec6f23f6b2100e432bfa794ba..c2eb8ff8402068d7480a3afd262219cb03841ae1 100644 (file)
@@ -313,14 +313,14 @@ static int should_expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
        return 0;
 }
 
-static int push_tip_to_list(const char *refname, const unsigned char *sha1,
+static int push_tip_to_list(const char *refname, const struct object_id *oid,
                            int flags, void *cb_data)
 {
        struct commit_list **list = cb_data;
        struct commit *tip_commit;
        if (flags & REF_ISSYMREF)
                return 0;
-       tip_commit = lookup_commit_reference_gently(sha1, 1);
+       tip_commit = lookup_commit_reference_gently(oid->hash, 1);
        if (!tip_commit)
                return 0;
        commit_list_insert(tip_commit, list);
@@ -352,6 +352,7 @@ static void reflog_expiry_prepare(const char *refname,
        if (cb->unreachable_expire_kind != UE_ALWAYS) {
                if (cb->unreachable_expire_kind == UE_HEAD) {
                        struct commit_list *elem;
+
                        for_each_ref(push_tip_to_list, &cb->tips);
                        for (elem = cb->tips; elem; elem = elem->next)
                                commit_list_insert(elem->item, &cb->mark_list);
@@ -379,14 +380,14 @@ static void reflog_expiry_cleanup(void *cb_data)
        }
 }
 
-static int collect_reflog(const char *ref, const unsigned char *sha1, int unused, void *cb_data)
+static int collect_reflog(const char *ref, const struct object_id *oid, int unused, void *cb_data)
 {
        struct collected_reflog *e;
        struct collect_reflog_cb *cb = cb_data;
        size_t namelen = strlen(ref);
 
        e = xmalloc(sizeof(*e) + namelen + 1);
-       hashcpy(e->sha1, sha1);
+       hashcpy(e->sha1, oid->hash);
        memcpy(e->reflog, ref, namelen + 1);
        ALLOC_GROW(cb->e, cb->nr + 1, cb->alloc);
        cb->e[cb->nr++] = e;