git-2.22.0/builtin/reflog.c
/*
 * Return true iff the specified reflog entry should be expired.
 */
Return true iff the specified reflog entry should be expired.
Return true iff the specified reflog entry should be expired .
static int should_expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
				    const char *email, timestamp_t timestamp, int tz,
				    const char *message, void *cb_data)
{
	struct expire_reflog_policy_cb *cb = cb_data;
	struct commit *old_commit, *new_commit;
	if (timestamp < cb->cmd.expire_total)
		return 1;
	old_commit = new_commit = NULL;
	if (cb->cmd.stalefix &&
	    (!keep_entry(&old_commit, ooid) || !keep_entry(&new_commit, noid)))
		return 1;
	if (timestamp < cb->cmd.expire_unreachable) {
		if (cb->unreachable_expire_kind == UE_ALWAYS)
			return 1;
		if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
			return 1;
	}
	if (cb->cmd.recno && --(cb->cmd.recno) == 0)
		return 1;
	return 0;
}
static int should_expire_reflog_ent ( struct object_id * ooid , struct object_id * noid , const char * email , timestamp_t timestamp , int tz , const char * message , void * cb_data ) { struct expire_reflog_policy_cb * cb = cb_data ; struct commit * old_commit , * new_commit ; if ( timestamp < cb -> cmd . expire_total ) return 1 ; old_commit = new_commit = NULL ; if ( cb -> cmd . stalefix && ( ! keep_entry ( & old_commit , ooid ) || ! keep_entry ( & new_commit , noid ) ) ) return 1 ; if ( timestamp < cb -> cmd . expire_unreachable ) { if ( cb -> unreachable_expire_kind == UE_ALWAYS ) return 1 ; if ( unreachable ( cb , old_commit , ooid ) || unreachable ( cb , new_commit , noid ) ) return 1 ; } if ( cb -> cmd . recno && -- ( cb -> cmd . recno ) == 0 ) return 1 ; return 0 ; }
Return true iff the specified reflog entry should be expired.
Return true iff the specified reflog entry should be expired .