refs: add referent to each_ref_fn
Add a parameter to each_ref_fn so that callers to the ref APIs that use this function as a callback can have acess to the unresolved value of a symbolic ref. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -857,7 +857,7 @@ static void send_unshallow(struct upload_pack_data *data)
|
||||
}
|
||||
}
|
||||
|
||||
static int check_ref(const char *refname_full, const struct object_id *oid,
|
||||
static int check_ref(const char *refname_full, const char *referent UNUSED, const struct object_id *oid,
|
||||
int flag, void *cb_data);
|
||||
static void deepen(struct upload_pack_data *data, int depth)
|
||||
{
|
||||
@ -1208,7 +1208,7 @@ static int mark_our_ref(const char *refname, const char *refname_full,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int check_ref(const char *refname_full, const struct object_id *oid,
|
||||
static int check_ref(const char *refname_full, const char *referent UNUSED,const struct object_id *oid,
|
||||
int flag UNUSED, void *cb_data)
|
||||
{
|
||||
const char *refname = strip_namespace(refname_full);
|
||||
@ -1276,14 +1276,14 @@ static void write_v0_ref(struct upload_pack_data *data,
|
||||
return;
|
||||
}
|
||||
|
||||
static int send_ref(const char *refname, const struct object_id *oid,
|
||||
static int send_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
|
||||
int flag UNUSED, void *cb_data)
|
||||
{
|
||||
write_v0_ref(cb_data, refname, strip_namespace(refname), oid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int find_symref(const char *refname,
|
||||
static int find_symref(const char *refname, const char *referent UNUSED,
|
||||
const struct object_id *oid UNUSED,
|
||||
int flag, void *cb_data)
|
||||
{
|
||||
|
Reference in New Issue
Block a user