DepthGenerator: remove redundant depth check

In DepthGenerator, commits are always added to the "pending" queue
either at depth 0 (in the constructor) or after a depth check (in
next()), so it is redundant to check for depth after removing them from
the queue. Remove the check.

This redundancy seems to have been present since the introduction of
server-side shallow clone support in commit 9952223e06 ("Implement
server support for shallow clones", 2011-08-21).

Change-Id: Iad334935293367400c2901a25c0f4bf36c437cf2
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
This commit is contained in:
Jonathan Tan 2018-09-12 12:49:40 -07:00
parent b2ee02f53b
commit 953cf2c9da
1 changed files with 1 additions and 2 deletions

View File

@ -160,8 +160,7 @@ RevCommit next() throws MissingObjectException,
}
}
// Produce all commits less than the depth cutoff
boolean produce = c.depth <= depth;
boolean produce = true;
// Unshallow commits are uninteresting, but still need to be sent
// up to the PackWriter so that it will exclude objects correctly.