Browse Source

RepoCommand should close opened repos

RepoCommand opend two repos without closing them or returning them to
the caller. This caused certain tests to fail on Windows.

Change-Id: Ia04924aaaad4d16f883b06404c2a85d3f801231f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v3.6.0.201412230720-r
Christian Halstrick 9 years ago
parent
commit
1a054f1229
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java View File

@@ -193,6 +193,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
try {
return readFileFromRepo(repo, ref, path);
} finally {
repo.close();
FileUtils.delete(dir, FileUtils.RECURSIVE);
}
}
@@ -860,6 +861,7 @@ public class RepoCommand extends GitCommand<RevCommit> {
if (revision != null) {
Git sub = new Git(subRepo);
sub.checkout().setName(findRef(revision, subRepo)).call();
subRepo.close();
git.add().addFilepattern(name).call();
}
for (CopyFile copyfile : copyfiles) {

Loading…
Cancel
Save