mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 20:15:52 +01:00
fix overview page for git repository without HEAD ref
This commit is contained in:
@@ -39,12 +39,14 @@ import org.apache.commons.lang.StringEscapeUtils;
|
||||
|
||||
import org.eclipse.jgit.api.Git;
|
||||
import org.eclipse.jgit.api.errors.NoHeadException;
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.PersonIdent;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
import org.eclipse.jgit.revwalk.RevCommit;
|
||||
|
||||
import sonia.scm.io.RegexResourceProcessor;
|
||||
import sonia.scm.io.ResourceProcessor;
|
||||
import sonia.scm.repository.GitUtil;
|
||||
import sonia.scm.util.IOUtil;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
@@ -103,8 +105,9 @@ public class GitRepositoryViewer
|
||||
{
|
||||
Git git = new Git(repository);
|
||||
int c = 0;
|
||||
ObjectId head = GitUtil.getRepositoryHead(repository);
|
||||
|
||||
for (RevCommit commit : git.log().call())
|
||||
for (RevCommit commit : git.log().add(head).call())
|
||||
{
|
||||
appendCommit(sb, commit);
|
||||
c++;
|
||||
|
||||
Reference in New Issue
Block a user