Class MidxPackFilter

java.lang.Object
org.eclipse.jgit.internal.storage.dfs.MidxPackFilter

public class MidxPackFilter extends Object
Format a flat list of packs and midxs into a valid list of packs.

A valid list of packs is either:

  • A list with midxs and uncovered packs
  • A list of packs (without any midx)
  • Method Details

    • skipMidxs

      public static List<DfsPackDescription> skipMidxs(List<DfsPackDescription> packs)
      Reorganize the flat list of packs removing the midxs
      Parameters:
      packs - flat list of all packs in the repo, may include midx. Packs covered by the midx appear also on their own.
      Returns:
      a list of packs without midxs
    • useMidx

      public static List<DfsPackDescription> useMidx(List<DfsPackDescription> packs)
      Remove from the list any packs covered by midxs.

      This verifies that all referenced packs by the midxs exist.

      Parameters:
      packs - list of packs with maybe some midxs
      Returns:
      midxs and uncovered packs. All the input packs if no midx. Ignore midxs with missing covered packs.