Correct thin pack completion in IndexPack to handle some bundles
commit186a0deb988a2436ce39b167407435f37eff5f84
authorShawn O. Pearce <spearce@spearce.org>
Tue, 1 Jul 2008 03:03:58 +0000 (30 23:03 -0400)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Tue, 1 Jul 2008 21:10:50 +0000 (1 23:10 +0200)
treed1db78eea2d508fb8f26f777fd654f0dc9296622
parent2111e7f4431c34b99cadc368e9a172b090c3fff4
Correct thin pack completion in IndexPack to handle some bundles

Recently I saw a bundle with a chain of deltas to base objects as
A->B->C, where A was the delta depending on the base B.  In this
pack all of the objects used OBJ_REF_DELTA to link to their base
and C was not in the pack (it was assumed to be in the repository).

Because of the ordering of the ObjectIds for B and C jgit tried to
resolve A's delta base by pulling from the repository, as B was not
found in the pack file.  The reason B was not found was because it
was waiting in the queue (to be processed next) and we did not know
what B's ObjectId was.

By skipping objects whose ObjectLoader's aren't found we should be
able to resolve those objects later when their delta base does get
resolved in this pack.  However by the end of of this loop we must
have no more objects depending on something by ObjectId, as that is
an indication that the local repository is missing the objects we
must have to complete this thin pack.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java