diff options
author | Jonathan Nieder <jrn@google.com> | 2019-11-26 23:56:40 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2019-11-26 23:56:40 -0500 |
commit | 853098e13eb82ff3c055da128d86ee2871c77a1a (patch) | |
tree | c97bce4a913ff1687aeb247a3e7bdfc9ca3650fd | |
parent | 533a81db9d5d6d58e03c54c22e4b7b15d4125095 (diff) | |
parent | 5897bc43064a10f175abf7cdecb3bdf457245a40 (diff) | |
download | jgit-853098e13eb82ff3c055da128d86ee2871c77a1a.tar.gz jgit-853098e13eb82ff3c055da128d86ee2871c77a1a.zip |
Merge "ReceivePack: Open visibility for some methods"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java index be28142917..16fbbd42f3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java @@ -1153,6 +1153,9 @@ public class ReceivePack { /** * Initialize the instance with the given streams. * + * Visible for out-of-tree subclasses (e.g. tests that need to set the + * streams without going through the {@link #service()} method). + * * @param input * raw input to read client commands and pack data from. Caller * must ensure the input is buffered, otherwise read performance @@ -1167,7 +1170,7 @@ public class ReceivePack { * standard error channel of the command execution. For most * other network connections this should be null. */ - private void init(final InputStream input, final OutputStream output, + protected void init(final InputStream input, final OutputStream output, final OutputStream messages) { origOut = output; rawIn = input; @@ -1207,10 +1210,15 @@ public class ReceivePack { /** * Receive a pack from the stream and check connectivity if necessary. * + * Visible for out-of-tree subclasses. Subclasses overriding this method + * should invoke this implementation, as it alters the instance state (e.g. + * it reads the pack from the input and parses it before running the + * connectivity checks). + * * @throws java.io.IOException * an error occurred during unpacking or connectivity checking. */ - private void receivePackAndCheckConnectivity() throws IOException { + protected void receivePackAndCheckConnectivity() throws IOException { receivePack(); if (needCheckConnectivity()) { checkSubmodules(); |