Skip to content

Commit

Permalink
each_ref_fn_adapter(): remove adapter
Browse files Browse the repository at this point in the history
All of the callers of the for_each_ref family of functions have now
been rewritten to work with object_ids, so this adapter is no longer
needed.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 25, 2015
1 parent c38cd1c commit 0a0c953
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
8 changes: 0 additions & 8 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,14 +2176,6 @@ int for_each_rawref(each_ref_fn fn, void *cb_data)
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
}

int each_ref_fn_adapter(const char *refname,
const struct object_id *oid, int flags, void *cb_data)
{
struct each_ref_fn_sha1_adapter *cb = cb_data;

return cb->original_fn(refname, oid->hash, flags, cb->original_cb_data);
}

const char *prettify_refname(const char *name)
{
return name + (
Expand Down
11 changes: 0 additions & 11 deletions refs.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@ struct ref_transaction;
typedef int each_ref_fn(const char *refname,
const struct object_id *oid, int flags, void *cb_data);

typedef int each_ref_sha1_fn(const char *refname,
const unsigned char *sha1, int flags, void *cb_data);

struct each_ref_fn_sha1_adapter {
each_ref_sha1_fn *original_fn;
void *original_cb_data;
};

extern int each_ref_fn_adapter(const char *refname,
const struct object_id *oid, int flags, void *cb_data);

/*
* The following functions invoke the specified callback function for
* each reference indicated. If the function ever returns a nonzero
Expand Down

0 comments on commit 0a0c953

Please sign in to comment.