]> source.dussan.org Git - jgit.git/commit
UploadPack: Use reachability checker to validate non-advertised wants 46/141846/5
authorIvan Frade <ifrade@google.com>
Wed, 8 May 2019 23:43:04 +0000 (16:43 -0700)
committerIvan Frade <ifrade@google.com>
Thu, 16 May 2019 23:31:16 +0000 (16:31 -0700)
commit7b96bd812e95d5aa87ea05b30d3e717360bdce20
tree70e16bb59daab51de970ce489ff03b299d0beeac
parent601b0ae577014e18929961f03a1940bc192d4ef4
UploadPack: Use reachability checker to validate non-advertised wants

In "Reachable commit" request validators, we need to check that a "want"
in the request, that hasn't been advertised, is reachable from the refs
visible to the user.

Current code has intermixed the translation of ObjectIds to RevCommits
(and its error handling) with the actual walk, with the delegation to
bitmaps in restricted circunstances.

Refactor the code to make it "flatter" and more readable. Move ObjectIds
to RevCommits translation to its own functions. Use the reachability
checker instead of a newly defined walk.

Before the non-advertised wants were validated with bitmaps only if any
"want" refered to an non-commit. Now they will be validated with bitmaps
also if the "wants" refer all to commits.

Change-Id: Ib925a48cde89672b07a88bba4e24d0457546baff
Signed-off-by: Ivan Frade <ifrade@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java