Change-Id: I667d685ccedc730e786f1e52323fdeba4b91af3e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
JGitText.get().invalidIgnoreParamSubmodule,
smw.getPath()), e);
}
- Repository subRepo = smw.getRepository();
- if (subRepo != null) {
- String subRepoPath = smw.getPath();
- try {
+ try (Repository subRepo = smw.getRepository()) {
+ if (subRepo != null) {
+ String subRepoPath = smw.getPath();
ObjectId subHead = subRepo.resolve("HEAD"); //$NON-NLS-1$
if (subHead != null
&& !subHead.equals(smw.getObjectId())) {
recordFileMode(subRepoPath, FileMode.GITLINK);
}
}
- } finally {
- subRepo.close();
}
}
}