Re: [PATCH v5 4/4] branch: let --delete-integrated find branches merged onto changed files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 30, 2026, 19:25 UTC
- Message-ID
- <xmqqwlqzuh1p.fsf@gitster.g>
- In-Reply-To
- <9443055242b8968e7196530bc67614d5b43d1a45.1793357582.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 21 quoted lines
> +static int merge_keeps_upstream(const struct branch_change *change)
> +{
> + mmfile_t base, upstream, branch;
> + mmfile_t result = { 0 };
> + int ret;
> +
> + read_mmblob(&base, the_repository->objects, &change->base_oid);
> + read_mmblob(&upstream, the_repository->objects, &change->upstream_oid);
> + read_mmblob(&branch, the_repository->objects, &change->branch_oid);
> + ret = ll_merge(&result, change->path, &base, "base",
> + &upstream, "upstream", &branch, "branch",
> + the_repository->index, NULL) == LL_MERGE_OK &&
> + result.size == upstream.size &&
> + !memcmp(result.ptr, upstream.ptr, upstream.size);
> +
> + free(base.ptr);
> + free(upstream.ptr);
> + free(branch.ptr);
> + free(result.ptr);
> + return ret;
> +}The function calls ll_merge() and passes the istate associated with the_repository global, but have we read the index before the control reaches this point? ll_merge() would want to consult custom low level merge from the attribute subsystem, and with istate that is not populated, it would fail to learn what the in-index attributes say, no?
If there is a reason why we want to ignore the attributes, perhaps we should explicitly say so.