Skip to content

Commit cc40b5c

Browse files
avargitster
authored andcommitted
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>
1 parent ae35e16 commit cc40b5c

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

builtin/reflog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
631631
struct collected_reflog *e = collected.e[i];
632632

633633
set_reflog_expiry_param(&cb.cmd, explicit_expiry, e->reflog);
634-
status |= reflog_expire(e->reflog, NULL, flags,
634+
status |= reflog_expire(e->reflog, flags,
635635
reflog_expiry_prepare,
636636
should_expire_reflog_ent,
637637
reflog_expiry_cleanup,
@@ -648,7 +648,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
648648
continue;
649649
}
650650
set_reflog_expiry_param(&cb.cmd, explicit_expiry, ref);
651-
status |= reflog_expire(ref, NULL, flags,
651+
status |= reflog_expire(ref, flags,
652652
reflog_expiry_prepare,
653653
should_expire_reflog_ent,
654654
reflog_expiry_cleanup,
@@ -723,7 +723,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
723723
cb.cmd.expire_total = 0;
724724
}
725725

726-
status |= reflog_expire(ref, NULL, flags,
726+
status |= reflog_expire(ref, flags,
727727
reflog_expiry_prepare,
728728
should_expire_reflog_ent,
729729
reflog_expiry_cleanup,

refs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,27 +2371,27 @@ int delete_reflog(const char *refname)
23712371
}
23722372

23732373
int refs_reflog_expire(struct ref_store *refs,
2374-
const char *refname, const struct object_id *oid,
2374+
const char *refname,
23752375
unsigned int flags,
23762376
reflog_expiry_prepare_fn prepare_fn,
23772377
reflog_expiry_should_prune_fn should_prune_fn,
23782378
reflog_expiry_cleanup_fn cleanup_fn,
23792379
void *policy_cb_data)
23802380
{
2381-
return refs->be->reflog_expire(refs, refname, oid, flags,
2381+
return refs->be->reflog_expire(refs, refname, flags,
23822382
prepare_fn, should_prune_fn,
23832383
cleanup_fn, policy_cb_data);
23842384
}
23852385

2386-
int reflog_expire(const char *refname, const struct object_id *oid,
2386+
int reflog_expire(const char *refname,
23872387
unsigned int flags,
23882388
reflog_expiry_prepare_fn prepare_fn,
23892389
reflog_expiry_should_prune_fn should_prune_fn,
23902390
reflog_expiry_cleanup_fn cleanup_fn,
23912391
void *policy_cb_data)
23922392
{
23932393
return refs_reflog_expire(get_main_ref_store(the_repository),
2394-
refname, oid, flags,
2394+
refname, flags,
23952395
prepare_fn, should_prune_fn,
23962396
cleanup_fn, policy_cb_data);
23972397
}

refs.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -816,20 +816,19 @@ typedef int reflog_expiry_should_prune_fn(struct object_id *ooid,
816816
typedef void reflog_expiry_cleanup_fn(void *cb_data);
817817

818818
/*
819-
* Expire reflog entries for the specified reference. oid is the old
820-
* value of the reference. flags is a combination of the constants in
819+
* Expire reflog entries for the specified reference.
820+
* flags is a combination of the constants in
821821
* enum expire_reflog_flags. The three function pointers are described
822822
* above. On success, return zero.
823823
*/
824824
int refs_reflog_expire(struct ref_store *refs,
825825
const char *refname,
826-
const struct object_id *oid,
827826
unsigned int flags,
828827
reflog_expiry_prepare_fn prepare_fn,
829828
reflog_expiry_should_prune_fn should_prune_fn,
830829
reflog_expiry_cleanup_fn cleanup_fn,
831830
void *policy_cb_data);
832-
int reflog_expire(const char *refname, const struct object_id *oid,
831+
int reflog_expire(const char *refname,
833832
unsigned int flags,
834833
reflog_expiry_prepare_fn prepare_fn,
835834
reflog_expiry_should_prune_fn should_prune_fn,

refs/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static void debug_reflog_expiry_cleanup(void *cb_data)
391391
}
392392

393393
static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
394-
const struct object_id *oid, unsigned int flags,
394+
unsigned int flags,
395395
reflog_expiry_prepare_fn prepare_fn,
396396
reflog_expiry_should_prune_fn should_prune_fn,
397397
reflog_expiry_cleanup_fn cleanup_fn,
@@ -404,7 +404,7 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
404404
.should_prune = should_prune_fn,
405405
.cb_data = policy_cb_data,
406406
};
407-
int res = drefs->refs->be->reflog_expire(drefs->refs, refname, oid,
407+
int res = drefs->refs->be->reflog_expire(drefs->refs, refname,
408408
flags, &debug_reflog_expiry_prepare,
409409
&debug_reflog_expiry_should_prune_fn,
410410
&debug_reflog_expiry_cleanup,

refs/files-backend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,7 +3027,7 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
30273027
}
30283028

30293029
static int files_reflog_expire(struct ref_store *ref_store,
3030-
const char *refname, const struct object_id *unused_oid,
3030+
const char *refname,
30313031
unsigned int flags,
30323032
reflog_expiry_prepare_fn prepare_fn,
30333033
reflog_expiry_should_prune_fn should_prune_fn,
@@ -3106,7 +3106,6 @@ static int files_reflog_expire(struct ref_store *ref_store,
31063106
}
31073107
}
31083108

3109-
assert(!unused_oid);
31103109
(*prepare_fn)(refname, oid, cb.policy_cb);
31113110
refs_for_each_reflog_ent(ref_store, refname, expire_reflog_ent, &cb);
31123111
(*cleanup_fn)(cb.policy_cb);

refs/packed-backend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ static int packed_delete_reflog(struct ref_store *ref_store,
16351635
}
16361636

16371637
static int packed_reflog_expire(struct ref_store *ref_store,
1638-
const char *refname, const struct object_id *oid,
1638+
const char *refname,
16391639
unsigned int flags,
16401640
reflog_expiry_prepare_fn prepare_fn,
16411641
reflog_expiry_should_prune_fn should_prune_fn,

refs/refs-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ typedef int create_reflog_fn(struct ref_store *ref_store, const char *refname,
593593
int force_create, struct strbuf *err);
594594
typedef int delete_reflog_fn(struct ref_store *ref_store, const char *refname);
595595
typedef int reflog_expire_fn(struct ref_store *ref_store,
596-
const char *refname, const struct object_id *oid,
596+
const char *refname,
597597
unsigned int flags,
598598
reflog_expiry_prepare_fn prepare_fn,
599599
reflog_expiry_should_prune_fn should_prune_fn,

0 commit comments

Comments
 (0)