]> source.dussan.org Git - jgit.git/commit
UploadPack: refactor want validation 02/14002/4
authorDave Borowitz <dborowitz@google.com>
Mon, 24 Jun 2013 00:02:29 +0000 (17:02 -0700)
committerDave Borowitz <dborowitz@google.com>
Wed, 3 Jul 2013 22:14:29 +0000 (15:14 -0700)
commit68ccc5d2137322118ed2a55f355e014a3670293a
tree3f864c4f4405ed585ba35ba75efd8348cafa0042
parente74751769e7be0901d1190e789bf360512ff3213
UploadPack: refactor want validation

Associate each RequestPolicy with an implementation of a
RequestValidator interface that contains the validation logic. The
checkWants method is only called if there are wants that were not
advertised, since clients may always request any advertised want
according to the git protocol. Calling the method only once at the
end of parsing the want list also means policy implementations can be
stateful, unlike the previous switch statement inside a loop.

For the special handling of unidirectional pipes, simply check
isBiDirectional() and delegate to other implementations if necessary.

Change-Id: I52a174999ac3a5aca46d3469cb0b81edd1710580
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java