Browse Source

Clone should create Git instances which are able to close repository

Bug: 474093
Change-Id: I13be133dac7834d1d2b51eb9948a716b8719d057
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
stable-4.1
Andrey Loskutov 9 years ago committed by Christian Halstrick
parent
commit
7979029b43
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java

2
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();

2
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;

Loading…
Cancel
Save