Re: [PATCH v2 06/11] refs API: pass the "lock OID" to reflog "prepare"
- From
Jeff King <peff@peff.net>
- Date
- Jul 17, 2021, 02:04 UTC
- Message-ID
- <YPI6v9BffiXc2TUj@coredump.intra.peff.net>
- In-Reply-To
- <patch-06.11-e93465f4137-20210716T140631Z-avarab@gmail.com>
On Fri, Jul 16, 2021 at 04:13:02PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> diff --git a/builtin/reflog.c b/builtin/reflog.c
> index 09541d1c804..9f9e6bceb03 100644
> --- a/builtin/reflog.c
> +++ b/builtin/reflog.c
> @@ -351,7 +351,7 @@ static int is_head(const char *refname)
> }
>
> static void reflog_expiry_prepare(const char *refname,
> - const struct object_id *oid,
> + struct object_id *locked_oid,
> void *cb_data)
> {Show 10 quoted lines
> struct expire_reflog_policy_cb *cb = cb_data;
> @@ -361,7 +361,7 @@ static void reflog_expiry_prepare(const char *refname,
> cb->unreachable_expire_kind = UE_HEAD;
> } else {
> cb->tip_commit = lookup_commit_reference_gently(the_repository,
> - oid, 1);
> + locked_oid, 1);
> if (!cb->tip_commit)
> cb->unreachable_expire_kind = UE_ALWAYS;
> elseThis drops "const" from the parameter (also below). I guess this is part of the preparation for making these functions do the locking. I'll read on...
-Peff