소스 검색

ReceivePack: Micro-optimize object lookup when checking connectivity

If we are checking the visibility of everything referenced in the
pack that isn't already reachable by a reference, it needs to be
in the provided set.  Since the provided set lists everything that
is in this pack, we can avoid checking to see if the blob exists
on disk, because we know it should be there, it was found in the
pack we just consumed.

Change-Id: Ie3c7746f734d13077242100a68e048f1ac18c34a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.8.1
Shawn O. Pearce 14 년 전
부모
커밋
a770205070
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7
    3
      org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java

+ 7
- 3
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java 파일 보기

@@ -823,11 +823,15 @@ public class ReceivePack {

RevObject o;
while ((o = ow.nextObject()) != null) {
if (ensureObjectsProvidedVisible) {
if (providedObjects.contains(o))
continue;
else
throw new MissingObjectException(o, o.getType());
}

if (o instanceof RevBlob && !db.hasObject(o))
throw new MissingObjectException(o, Constants.TYPE_BLOB);

if (ensureObjectsProvidedVisible && !providedObjects.contains(o))
throw new MissingObjectException(o, o.getType());
}
}


Loading…
취소
저장