aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2014-12-12 00:34:31 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2014-12-12 14:06:51 +0100
commit1a054f12298f5c34efc9da7f4b43c73904f68fc0 (patch)
tree9c0a114793db5e72473d8eeba0ebb155be354bc8 /org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
parent35c00a7a73399aafd6d71acb786387a6d558e2b4 (diff)
downloadjgit-1a054f12298f5c34efc9da7f4b43c73904f68fc0.tar.gz
jgit-1a054f12298f5c34efc9da7f4b43c73904f68fc0.zip
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>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
index 1c4c3db0d3..4207513e70 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoCommand.java
@@ -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) {