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:
Shawn O. Pearce 2011-02-05 18:47:42 -08:00
parent b5da75bb87
commit 0fe7eeba04
1 changed files with 3 additions and 5 deletions

View File

@ -499,6 +499,9 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last)
wantAll.add(obj);
}
if (!(obj instanceof RevCommit))
obj.add(SATISFIED);
if (obj instanceof RevTag) {
RevObject target = walk.peel(obj);
if (target instanceof RevCommit) {
@ -601,11 +604,6 @@ private boolean wantSatisfied(final RevObject want) throws IOException {
if (want.has(SATISFIED))
return true;
if (!(want instanceof RevCommit)) {
want.add(SATISFIED);
return true;
}
walk.resetRetain(SAVE);
walk.markStart((RevCommit) want);
for (;;) {