UploadPack: Tag non-commits SATISIFIED earlier
This gets non-commits out of the wantSatisfied() main loop by making use of the cached SATISIFIED flag and its existing bypass. Anything that isn't a commit cannot be discovered by the have negotiation, so its always assumed to be SATISIFIED by the server. Bug: 301639 Change-Id: I1ef354fbf2e2ed44c9020a4069d7179f2159f19f Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
b5da75bb87
commit
0fe7eeba04
|
@ -499,6 +499,9 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last)
|
||||||
wantAll.add(obj);
|
wantAll.add(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(obj instanceof RevCommit))
|
||||||
|
obj.add(SATISFIED);
|
||||||
|
|
||||||
if (obj instanceof RevTag) {
|
if (obj instanceof RevTag) {
|
||||||
RevObject target = walk.peel(obj);
|
RevObject target = walk.peel(obj);
|
||||||
if (target instanceof RevCommit) {
|
if (target instanceof RevCommit) {
|
||||||
|
@ -601,11 +604,6 @@ private boolean wantSatisfied(final RevObject want) throws IOException {
|
||||||
if (want.has(SATISFIED))
|
if (want.has(SATISFIED))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!(want instanceof RevCommit)) {
|
|
||||||
want.add(SATISFIED);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
walk.resetRetain(SAVE);
|
walk.resetRetain(SAVE);
|
||||||
walk.markStart((RevCommit) want);
|
walk.markStart((RevCommit) want);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
Loading…
Reference in New Issue