mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-09 22:00:20 +01:00
improve performance
This commit is contained in:
@@ -267,16 +267,20 @@ public class GitRepositoryBrowser implements RepositoryBrowser
|
||||
file.setDirectory(loader.getType() == Constants.OBJ_TREE);
|
||||
file.setLength(loader.getSize());
|
||||
|
||||
RevCommit commit = getLatestCommit(repo, revId, path);
|
||||
// don't show message and date for directories to improve performance
|
||||
if (!file.isDirectory())
|
||||
{
|
||||
RevCommit commit = getLatestCommit(repo, revId, path);
|
||||
|
||||
if (commit != null)
|
||||
{
|
||||
file.setLastModified(GitUtil.getCommitTime(commit));
|
||||
file.setDescription(commit.getShortMessage());
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not find latest commit for {} on {}", path, revId);
|
||||
if (commit != null)
|
||||
{
|
||||
file.setLastModified(GitUtil.getCommitTime(commit));
|
||||
file.setDescription(commit.getShortMessage());
|
||||
}
|
||||
else if (logger.isWarnEnabled())
|
||||
{
|
||||
logger.warn("could not find latest commit for {} on {}", path, revId);
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
|
||||
Reference in New Issue
Block a user