Clone should create Git instances which are able to close repository

Bug: 474093
Change-Id: I13be133dac7834d1d2b51eb9948a716b8719d057
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
This commit is contained in:
Andrey Loskutov 2015-08-03 20:58:46 +02:00 committed by Christian Halstrick
parent 5c2f52f72b
commit 7979029b43
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ public Git call() throws GitAPIException, InvalidRemoteException,
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();

View File

@ -207,7 +207,7 @@ public Git(Repository repo) {
this(repo, false);
}
private Git(Repository repo, boolean closeRepo) {
Git(Repository repo, boolean closeRepo) {
if (repo == null)
throw new NullPointerException();
this.repo = repo;