mirror of
https://github.com/git/git.git
synced 2025-01-19 22:13:32 +08:00
refs API: remove OID argument to reflog_expire()
Since the the preceding commit the "oid" parameter to reflog_expire() is always NULL, but it was not cleaned up to reduce the size of the diff. Let's do that subsequent API and documentation cleanup now. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ae35e16cd4
commit
cc40b5ce13
@ -631,7 +631,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
|
||||
struct collected_reflog *e = collected.e[i];
|
||||
|
||||
set_reflog_expiry_param(&cb.cmd, explicit_expiry, e->reflog);
|
||||
status |= reflog_expire(e->reflog, NULL, flags,
|
||||
status |= reflog_expire(e->reflog, flags,
|
||||
reflog_expiry_prepare,
|
||||
should_expire_reflog_ent,
|
||||
reflog_expiry_cleanup,
|
||||
@ -648,7 +648,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
|
||||
continue;
|
||||
}
|
||||
set_reflog_expiry_param(&cb.cmd, explicit_expiry, ref);
|
||||
status |= reflog_expire(ref, NULL, flags,
|
||||
status |= reflog_expire(ref, flags,
|
||||
reflog_expiry_prepare,
|
||||
should_expire_reflog_ent,
|
||||
reflog_expiry_cleanup,
|
||||
@ -723,7 +723,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
|
||||
cb.cmd.expire_total = 0;
|
||||
}
|
||||
|
||||
status |= reflog_expire(ref, NULL, flags,
|
||||
status |= reflog_expire(ref, flags,
|
||||
reflog_expiry_prepare,
|
||||
should_expire_reflog_ent,
|
||||
reflog_expiry_cleanup,
|
||||
|
8
refs.c
8
refs.c
@ -2371,19 +2371,19 @@ int delete_reflog(const char *refname)
|
||||
}
|
||||
|
||||
int refs_reflog_expire(struct ref_store *refs,
|
||||
const char *refname, const struct object_id *oid,
|
||||
const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
reflog_expiry_cleanup_fn cleanup_fn,
|
||||
void *policy_cb_data)
|
||||
{
|
||||
return refs->be->reflog_expire(refs, refname, oid, flags,
|
||||
return refs->be->reflog_expire(refs, refname, flags,
|
||||
prepare_fn, should_prune_fn,
|
||||
cleanup_fn, policy_cb_data);
|
||||
}
|
||||
|
||||
int reflog_expire(const char *refname, const struct object_id *oid,
|
||||
int reflog_expire(const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
@ -2391,7 +2391,7 @@ int reflog_expire(const char *refname, const struct object_id *oid,
|
||||
void *policy_cb_data)
|
||||
{
|
||||
return refs_reflog_expire(get_main_ref_store(the_repository),
|
||||
refname, oid, flags,
|
||||
refname, flags,
|
||||
prepare_fn, should_prune_fn,
|
||||
cleanup_fn, policy_cb_data);
|
||||
}
|
||||
|
7
refs.h
7
refs.h
@ -816,20 +816,19 @@ typedef int reflog_expiry_should_prune_fn(struct object_id *ooid,
|
||||
typedef void reflog_expiry_cleanup_fn(void *cb_data);
|
||||
|
||||
/*
|
||||
* Expire reflog entries for the specified reference. oid is the old
|
||||
* value of the reference. flags is a combination of the constants in
|
||||
* Expire reflog entries for the specified reference.
|
||||
* flags is a combination of the constants in
|
||||
* enum expire_reflog_flags. The three function pointers are described
|
||||
* above. On success, return zero.
|
||||
*/
|
||||
int refs_reflog_expire(struct ref_store *refs,
|
||||
const char *refname,
|
||||
const struct object_id *oid,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
reflog_expiry_cleanup_fn cleanup_fn,
|
||||
void *policy_cb_data);
|
||||
int reflog_expire(const char *refname, const struct object_id *oid,
|
||||
int reflog_expire(const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
|
@ -391,7 +391,7 @@ static void debug_reflog_expiry_cleanup(void *cb_data)
|
||||
}
|
||||
|
||||
static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
|
||||
const struct object_id *oid, unsigned int flags,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
reflog_expiry_cleanup_fn cleanup_fn,
|
||||
@ -404,7 +404,7 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
|
||||
.should_prune = should_prune_fn,
|
||||
.cb_data = policy_cb_data,
|
||||
};
|
||||
int res = drefs->refs->be->reflog_expire(drefs->refs, refname, oid,
|
||||
int res = drefs->refs->be->reflog_expire(drefs->refs, refname,
|
||||
flags, &debug_reflog_expiry_prepare,
|
||||
&debug_reflog_expiry_should_prune_fn,
|
||||
&debug_reflog_expiry_cleanup,
|
||||
|
@ -3027,7 +3027,7 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
|
||||
}
|
||||
|
||||
static int files_reflog_expire(struct ref_store *ref_store,
|
||||
const char *refname, const struct object_id *unused_oid,
|
||||
const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
@ -3106,7 +3106,6 @@ static int files_reflog_expire(struct ref_store *ref_store,
|
||||
}
|
||||
}
|
||||
|
||||
assert(!unused_oid);
|
||||
(*prepare_fn)(refname, oid, cb.policy_cb);
|
||||
refs_for_each_reflog_ent(ref_store, refname, expire_reflog_ent, &cb);
|
||||
(*cleanup_fn)(cb.policy_cb);
|
||||
|
@ -1635,7 +1635,7 @@ static int packed_delete_reflog(struct ref_store *ref_store,
|
||||
}
|
||||
|
||||
static int packed_reflog_expire(struct ref_store *ref_store,
|
||||
const char *refname, const struct object_id *oid,
|
||||
const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
|
@ -593,7 +593,7 @@ typedef int create_reflog_fn(struct ref_store *ref_store, const char *refname,
|
||||
int force_create, struct strbuf *err);
|
||||
typedef int delete_reflog_fn(struct ref_store *ref_store, const char *refname);
|
||||
typedef int reflog_expire_fn(struct ref_store *ref_store,
|
||||
const char *refname, const struct object_id *oid,
|
||||
const char *refname,
|
||||
unsigned int flags,
|
||||
reflog_expiry_prepare_fn prepare_fn,
|
||||
reflog_expiry_should_prune_fn should_prune_fn,
|
||||
|
Loading…
Reference in New Issue
Block a user