public static DiffStat getDiffStat(Repository repository, String base, String tip) {\r
RevCommit baseCommit = null;\r
RevCommit tipCommit = null;\r
- RevWalk revWalk = null;\r
+ RevWalk revWalk = new RevWalk(repository);\r
try {\r
- revWalk = new RevWalk(repository);\r
tipCommit = revWalk.parseCommit(repository.resolve(tip));\r
if (!StringUtils.isEmpty(base)) {\r
baseCommit = revWalk.parseCommit(repository.resolve(base));\r
}\r
+ return getDiffStat(repository, baseCommit, tipCommit, null);\r
} catch (Exception e) {\r
LOGGER.error("failed to generate diffstat!", e);\r
} finally {\r
revWalk.dispose();\r
}\r
- return getDiffStat(repository, baseCommit, tipCommit, null);\r
+ return null;\r
}\r
\r
public static DiffStat getDiffStat(Repository repository, RevCommit commit) {\r