Browse Source

[infer] Fix SubmoduleWalk leaks in submodule commands

Bug: 509385
Change-Id: I4cba81d8ea596800a40799dc9cb763fae01fe508
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.6
Matthias Sohn 8 years ago
parent
commit
aa199ff648
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java
  2. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java
  3. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java

3
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java

@ -94,8 +94,7 @@ public class SubmoduleInitCommand extends GitCommand<Collection<String>> {
public Collection<String> call() throws GitAPIException {
checkCallable();
try {
SubmoduleWalk generator = SubmoduleWalk.forIndex(repo);
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
StoredConfig config = repo.getConfig();

3
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java

@ -94,8 +94,7 @@ public class SubmoduleStatusCommand extends
public Map<String, SubmoduleStatus> call() throws GitAPIException {
checkCallable();
try {
SubmoduleWalk generator = SubmoduleWalk.forIndex(repo);
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
Map<String, SubmoduleStatus> statuses = new HashMap<String, SubmoduleStatus>();

3
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java

@ -111,8 +111,7 @@ public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
public Map<String, String> call() throws GitAPIException {
checkCallable();
try {
SubmoduleWalk generator = SubmoduleWalk.forIndex(repo);
try (SubmoduleWalk generator = SubmoduleWalk.forIndex(repo)) {
if (!paths.isEmpty())
generator.setFilter(PathFilterGroup.createFromStrings(paths));
Map<String, String> synced = new HashMap<String, String>();

Loading…
Cancel
Save