summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov <loskutov@gmx.de>2015-08-03 20:58:46 +0200
committerChristian Halstrick <christian.halstrick@sap.com>2015-08-04 13:37:58 +0200
commit7979029b439832418e268982a42b5de1aba7c4b4 (patch)
tree25f2f534872b8d5c9a5c459b5217585fbf98867d
parent5c2f52f72b1ab84328bc161fb9884224a6296bba (diff)
downloadjgit-7979029b439832418e268982a42b5de1aba7c4b4.tar.gz
jgit-7979029b439832418e268982a42b5de1aba7c4b4.zip
Clone should create Git instances which are able to close repository
Bug: 474093 Change-Id: I13be133dac7834d1d2b51eb9948a716b8719d057 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java2
2 files changed, 2 insertions, 2 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 4aaee8d96d..b3bc319aef 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
@@ -134,7 +134,7 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
FetchResult result = fetch(repository, u);
if (!noCheckout)
checkout(repository, result);
- return new Git(repository);
+ return new Git(repository, true);
} catch (IOException ioe) {
if (repository != null) {
repository.close();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
index 1e9fe5c25f..addca4c469 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
@@ -207,7 +207,7 @@ public class Git implements AutoCloseable {
this(repo, false);
}
- private Git(Repository repo, boolean closeRepo) {
+ Git(Repository repo, boolean closeRepo) {
if (repo == null)
throw new NullPointerException();
this.repo = repo;