From: Shawn O. Pearce Date: Sat, 02 May 2009 20:30:30 GMT Subject: [JGIT PATCH 2/2] Correct Javadoc comment for TransportLocal about forking Message-ID: <1241296230-19342-2-git-send-email-spearce@spearce.org> In-Reply-To: <1241296230-19342-1-git-send-email-spearce@spearce.org> Since a4548aedff ("Switch local fetch connection to use our own UploadPack") this code has tried to avoid forking to execute the CGit upload-pack or receive-pack processes, instead favoring the creation of a helper thread and performing all work through a shared memory buffer within the same JVM. Update the Javadoc to better reflect what this class does. Signed-off-by: Shawn O. Pearce --- .../org/spearce/jgit/transport/TransportLocal.java | 24 +++++++++++++++---- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java index d5a6c14..230ab76 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java +++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java @@ -52,13 +52,27 @@ import org.spearce.jgit.util.FS; /** - * Transport that executes the Git "remote side" processes on a local directory. + * Transport to access a local directory as though it were a remote peer. *

* This transport is suitable for use on the local system, where the caller has - * direct read or write access to the remote repository. This implementation - * forks a C Git process to provide the remote side access, much as the - * {@link TransportGitSsh} implementation causes the remote side to run a C Git - * process. + * direct read or write access to the "remote" repository. + *

+ * By default this transport works by spawning a helper thread within the same + * JVM, and processes the data transfer using a shared memory buffer between the + * calling thread and the helper thread. This is a pure-Java implementation + * which does not require forking an external process. + *

+ * However, during {@link #openFetch()}, if the Transport has configured + * {@link Transport#getOptionUploadPack()} to be anything other than + * "git-upload-pack" or "git upload-pack", this + * implementation will fork and execute the external process, using an operating + * system pipe to transfer data. + *

+ * However, during {@link #openPush()}, if the Transport has configured + * {@link Transport#getOptionReceivePack()} to be anything other than + * "git-receive-pack" or "git receive-pack", this + * implementation will fork and execute the external process, using an operating + * system pipe to transfer data. */ class TransportLocal extends Transport implements PackTransport { private static final String PWD = "."; -- 1.6.3.rc3.212.g8c698