Show 46 quoted lines
> diff --git a/object-file.c b/object-file.c
> index 210984f825..74a31760bc 100644
> --- a/object-file.c
> +++ b/object-file.c
> @@ -1424,34 +1464,57 @@ static int odb_transaction_files_write_pack(struct odb_transaction *base,
> return -1;
> }
>
> - /*
> - * The lockfile filepath is expected to be the final location of
> - * the ".keep" file after being migrated to the main ODB source.
> - * This ensures the lockfile can be found and removed later
> - * after the ODB transaction has been committed.
> - */
> - lockfile = index_pack_lockfile(base->source, child.out, NULL);
> - if (lockfile) {
> - ALLOC_GROW(transaction->pack_lockfiles,
> - transaction->pack_lockfiles_nr + 1,
> - transaction->pack_lockfiles_alloc);
> - transaction->pack_lockfiles[transaction->pack_lockfiles_nr++] =
> - register_tempfile(lockfile);
> - free(lockfile);
> - }
> + ret = read_index_pack_report(repo, child.out, &pack_name, NULL);
> +
> close(child.out);
>
> status = finish_command(&child);
> if (status) {
> strbuf_addstr(err_msg, "index-pack abnormal exit");
> - return -1;
> + goto out;
> + }
> +
> + if (ret) {
> + strbuf_addstr(err_msg, "index-pack failed to report pack name");
> + goto out;
> }
>
> + strbuf_addf(&keep_msg, "receive-pack %"PRIuMAX" on %s",
> + (uintmax_t)getpid(), hostname);
> +
> + if (write_pack_lockfile(transaction->quarantine, pack_name.buf,
> + keep_msg.buf)) {
> + strbuf_addstr(err_msg, "lockfile write failed");
> + goto out;