Skip to content

Commit 2c928bc

Browse files
revert file to default
1 parent 3978c41 commit 2c928bc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

core/src/main/scala/com/codacy/analysis/core/git/Repository.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.codacy.analysis.core.git
22

33
import org.eclipse.jgit.api.{Git => JGit}
44
import org.eclipse.jgit.lib.{Repository => JGitRepository}
5-
import org.eclipse.jgit.api.errors.GitAPIException;
65

76
import scala.collection.JavaConverters._
87
import 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
}

0 commit comments

Comments
 (0)