aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2015-01-23 02:54:33 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2015-01-23 02:54:33 -0500
commit8f8724c857d7f6b1184bd81952e3895bba9e3724 (patch)
tree781fc77f9d2038c80a345495c8b8748e38b3a4aa /org.eclipse.jgit
parent9ffe6deced8dd79dd283fff650a8ac19ce3d9a08 (diff)
parent83d7ea19889ef5c0aafc04a5622643822d204f35 (diff)
downloadjgit-8f8724c857d7f6b1184bd81952e3895bba9e3724.tar.gz
jgit-8f8724c857d7f6b1184bd81952e3895bba9e3724.zip
Merge changes I05be0a5b,Ieee334f4
* changes: Document that repo returned by SubmoduleAddCommand needs to be closed Document that Git instance returned by CloneCommand needs to be closed
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java11
2 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
index de24dadff6..f058f799d3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
@@ -114,6 +114,12 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
/**
* Executes the {@code Clone} command.
*
+ * The Git instance returned by this command needs to be closed by the
+ * caller to free resources held by the underlying {@link Repository}
+ * instance. It is recommended to call this method as soon as you don't need
+ * a reference to this {@link Git} instance and the underlying
+ * {@link Repository} instance anymore.
+ *
* @return the newly created {@code Git} object with associated repository
* @throws InvalidRemoteException
* @throws org.eclipse.jgit.api.errors.TransportException
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java
index 09e4cf0a1b..06c8f414e3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java
@@ -136,6 +136,17 @@ public class SubmoduleAddCommand extends
return SubmoduleWalk.forIndex(repo).setFilter(filter).next();
}
+ /**
+ * Executes the {@code SubmoduleAddCommand}
+ *
+ * The {@code Repository} instance returned by this command needs to be
+ * closed by the caller to free resources held by the {@code Repository}
+ * instance. It is recommended to call this method as soon as you don't need
+ * a reference to this {@code Repository} instance anymore.
+ *
+ * @return the newly created {@link Repository}
+ * @throws GitAPIException
+ */
public Repository call() throws GitAPIException {
checkCallable();
if (path == null || path.length() == 0)