Skip to content

Add QuarantineOnly for getting the repository with its quarantine only

Sami Hiltunen requested to merge smh-quarantine-only-repo into master

Repository quarantining works by configuring a temporary object directory via the GIT_OBJECT_DIRECTORY environment variable, and configuring the actual object directory as an alternate via GIT_ALTERNATE_OBJECT_DIRECTORIES. This ensures that new objects are written into the quarantine but the old objects are still readable through the alternate.

There are some use cases where we don't want to have the alternate configured. For example, if we want to list only the new objects in the quarantine, we can invoke Git without the alternate configured. This way Git only sees the new objects.

We're soon going to walk the new objects a transaction introduced to pack them in TransactionManager. To do so, this MR implements a helper method to get a quarantined localrepo.Repo instance without the alternates configured.

While at it, we piggyback two changes to the tests to prepare them for the actual MR that makes use of the new quarantine only functionality.

Related to #5770 (closed)

Edited by Sami Hiltunen

Merge request reports