File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
core/src/main/scala/com/codacy/analysis/core/git Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package com.codacy.analysis.core.git
22
33import org .eclipse .jgit .api .{Git => JGit }
44import org .eclipse .jgit .lib .{Repository => JGitRepository }
5- import org .eclipse .jgit .api .errors .GitAPIException ;
65
76import scala .collection .JavaConverters ._
87import scala .util .Try
@@ -12,15 +11,12 @@ class Repository(repository: JGitRepository) {
1211 val jGit : JGit = new JGit (repository)
1312
1413 def latestCommit : Try [Commit ] = {
15- try {
14+ Try {
1615 val gitLog = jGit.log().setMaxCount(1 ).call()
1716
1817 val revCommit = gitLog.iterator().next()
1918
2019 new Commit (repository, revCommit)
21- } catch (GitAPIException | IOException e) {
22- System .err.println(" An error occurred while getting the latest commit: " + e.getMessage());
23- e.printStackTrace();
2420 }
2521 }
2622
@@ -32,4 +28,5 @@ class Repository(repository: JGitRepository) {
3228 javaSet.asScala.toSet
3329 }
3430 }
31+
3532}
You can’t perform that action at this time.
0 commit comments