Change-Id: I62d6de7d67c7de2460f4cbe918ad2bb8109650b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
List<Ref> cherryPickedRefs = new LinkedList<Ref>();
checkCallable();
- RevWalk revWalk = new RevWalk(repo);
- try {
+ try (RevWalk revWalk = new RevWalk(repo)) {
// get the head commit
Ref headRef = repo.getRef(Constants.HEAD);
MessageFormat.format(
JGitText.get().exceptionCaughtDuringExecutionOfCherryPickCommand,
e), e);
- } finally {
- revWalk.release();
}
return new CherryPickResult(newHead, cherryPickedRefs);
}