]> source.dussan.org Git - jgit.git/commit
Extract protocol v2 fetch request parsing to its own class 97/128397/8
authorIvan Frade <ifrade@google.com>
Mon, 27 Aug 2018 18:00:41 +0000 (11:00 -0700)
committerJonathan Nieder <jrn@google.com>
Fri, 31 Aug 2018 22:31:36 +0000 (15:31 -0700)
commita8c38bc767778f718b24cca4a97b624c16278fb8
tree8892bd77a49c4f909d9e51d49f0ec6590a64f956
parent346bc34169e86121b71206374653891dc5bc4512
Extract protocol v2 fetch request parsing to its own class

The parsing code for protocol v2 fetch doesn't have any dependency on
the rest of UploadPack.

Move it to its own class. This makes testing easier (no need to
instantiate the full UploadPack), simplifies the code in UploadPack and
increases modularity.

At the moment, the parser needs to know about the reference database to
validate incoming references. This dependency could be easily removed
moving the validation later in the flow, after the parsing, where other
validations are already happening. Postponing that to keep this patch
about moving unmodified code around.

Change-Id: I7ad29a6b99caa7c12c06f5a7f30ab6a5f6e44dc7
Signed-off-by: Ivan Frade <ifrade@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ProtocolV2ParserTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/transport/ProtocolV2Parser.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java