diff options
author | David Ostrovsky <david@ostrovsky.org> | 2020-11-29 13:06:00 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2020-11-29 22:46:51 +0100 |
commit | 23389a63238c50daf0d8d1e3fd2b1d29f4171645 (patch) | |
tree | ca8a64314f55368e760f0263a4d9cf3f273ab479 /org.eclipse.jgit.http.test/tst | |
parent | 5cd485e5dda41d2ef06226a692c64f1aa221eb25 (diff) | |
download | jgit-23389a63238c50daf0d8d1e3fd2b1d29f4171645.tar.gz jgit-23389a63238c50daf0d8d1e3fd2b1d29f4171645.zip |
Add constants for parsing git wire protocol version
This would allow other JGit users to access and reuse the constants.
Change-Id: I1608802f45586af5f8582afa592e26679e9cebe3
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst')
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java index 96657761cf..26a453be14 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java @@ -38,6 +38,7 @@ import org.eclipse.jgit.internal.JGitText; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.AccessEvent; import org.eclipse.jgit.junit.http.AppServer; +import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; @@ -49,6 +50,7 @@ import org.eclipse.jgit.transport.HttpTransport; import org.eclipse.jgit.transport.PacketLineIn; import org.eclipse.jgit.transport.PacketLineOut; import org.eclipse.jgit.transport.Transport; +import org.eclipse.jgit.transport.TransferConfig; import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.transport.http.HttpConnection; @@ -342,8 +344,10 @@ public class HttpClientTests extends AllFactoriesHttpTestCase { @Test public void testV2HttpFirstResponse() throws Exception { - remoteRepository.getRepository().getConfig().setInt( - "protocol", null, "version", 2); + remoteRepository.getRepository().getConfig().setString( + ConfigConstants.CONFIG_PROTOCOL_SECTION, null, + ConfigConstants.CONFIG_KEY_VERSION, + TransferConfig.ProtocolVersion.V2.version()); String url = smartAuthNoneURI.toString() + "/info/refs?service=git-upload-pack"; HttpConnection c = HttpTransport.getConnectionFactory() @@ -364,8 +368,10 @@ public class HttpClientTests extends AllFactoriesHttpTestCase { @Test public void testV2HttpSubsequentResponse() throws Exception { - remoteRepository.getRepository().getConfig().setInt( - "protocol", null, "version", 2); + remoteRepository.getRepository().getConfig().setString( + ConfigConstants.CONFIG_PROTOCOL_SECTION, null, + ConfigConstants.CONFIG_KEY_VERSION, + TransferConfig.ProtocolVersion.V2.version()); String url = smartAuthNoneURI.toString() + "/git-upload-pack"; HttpConnection c = HttpTransport.getConnectionFactory() |