Re: [PATCH] pack-objects: handle missing objects when excluding promisor objects
- From
- Sami Jawhar <sami@theorem.dev>
- Date
- Nov 28, 2026, 20:10 UTC
- Message-ID
- <CAOJ8FdcTRUEOJhTnUzX5a4F2H+34PwG_GuXEtW-nO3pY-ULh8Q@mail.gmail.com>
- In-Reply-To
- <20261027-b4-pks-pack-objects-repack-links-with-missing-objects-v1-1-f50f90651274@pks.im>
On Tue, Oct 27, 2026 at 08:00:28AM +0100, Patrick Steinhardt wrote:
> This bug can trigger in situations where we have e.g. a combination of > shallow and partial clones, [...]
The BUG occurs with no moved ref, in a depth-2 clone of a merge commit. A CI job in one repository ran this fetch after a depth-2 checkout of a pull request's merge commit:
set -e
export GIT_AUTHOR_NAME=t GIT_AUTHOR_EMAIL=t@example.com
export GIT_COMMITTER_NAME=t GIT_COMMITTER_EMAIL=t@example.com
cd "$(mktemp -d)"
git init -q -b main origin
cd origin
git config uploadpack.allowFilter true
echo root >f && git add f && git commit -q -m root
echo main >f && git commit -q -am main1
git checkout -q -b side
echo 1 >s && git add s && git commit -q -m side1
echo 2 >s && git commit -q -am side2
git checkout -q main
git merge -q --no-ff -m merge side
cd ..
git clone -q --depth 2 "file://$PWD/origin" clone
git -C clone fetch --filter=tree:0 --unshallow originExit status of the last command:
d43b9acb05^ 0
d43b9acb05 128, BUG at pack-objects.c:5004
v2.56.1 128, BUG at pack-objects.c:5098
master (acba8bf975) 128, BUG at pack-objects.c:5139
v2.56.1 with this patch 0, and "git fsck" exits 0
master with v5 of [1] 0, and "git fsck" exits 0On v2.56.1 the fetch exits 0 in each of these cases:
- --filter=blob:none in place of --filter=tree:0 - no filter - side has one commit - side forks from root
[1] <pull.2333.v5.git.1795650160536.gitgitgadget@gmail.com>
Tested-by: Sami Jawhar <sami@theorem.dev>