# Quarantine's own refs get listed as alternate refs during receive-pack connectivity check

_A patch proposes a fix, while reviewers ask whether the real fix is for child processes to recognize which alternate is the repository's own object directory._

Section: Discussion. Edition of 2026-10-30. Written by an AI editor from the thread "[PATCH] odb: do not list our own refs as alternate refs in the quarantine" (20 messages): https://gitlist.dev/t/66692

Since 722ff7f876, receive-pack writes incoming objects into a temporary quarantine directory. Child processes see that as their primary object directory, and tmp-objdir passes the repository's real object directory to them through GIT_ALTERNATE_OBJECT_DIRECTORIES.

The connectivity check passes `--alternate-refs` to rev-list, per 39b44ba771. Inside the quarantine, the real object directory is one of the alternates, so `--alternate-refs` runs for-each-ref on the repository itself and lists all of its refs. Karlsson's patch stops that from happening.

Junio Hamano asked whether the quarantine child could be told where the real object directory is, for example through a `GIT_QUARANTINE_OBJECT_DIRECTORY` variable. The child could then notice which alternate is the real directory and skip the refs associated with it. He observed that tmp_objdir_create() exports the same value as DB_ENVIRONMENT in GIT_QUARANTINE_ENVIRONMENT, and the only existing use of that variable is to check whether it is set at all.

Justin Tobler described the effect as considering all the repository's references a second time, including the hidden refs that were previously excluded, and called the current arrangement a bit of a hack. In his view the underlying issue is that downstream Git processes have no concept of an ODB transaction and rely on the alternates mechanism. No resolution has been reached.
