38
38
import com .gitblit .models .RefModel ;
39
39
import com .gitblit .models .RepositoryCommit ;
40
40
import com .gitblit .servlet .BranchGraphServlet ;
41
+ import com .gitblit .utils .ArrayUtils ;
41
42
import com .gitblit .utils .JGitUtils ;
42
43
import com .gitblit .utils .StringUtils ;
43
44
import com .gitblit .wicket .ExternalImage ;
@@ -63,7 +64,7 @@ public LogPanel(String wicketId, final String repositoryName, final String objec
63
64
itemsPerPage = 50 ;
64
65
}
65
66
66
- final Map <ObjectId , List <RefModel >> allRefs = JGitUtils .getAllRefs (r , showRemoteRefs );
67
+ Map <ObjectId , List <RefModel >> allRefs = JGitUtils .getAllRefs (r , showRemoteRefs );
67
68
List <RevCommit > commits ;
68
69
if (pageResults ) {
69
70
// Paging result set
@@ -77,8 +78,8 @@ public LogPanel(String wicketId, final String repositoryName, final String objec
77
78
// works unless commits.size() represents the exact end.
78
79
hasMore = commits .size () >= itemsPerPage ;
79
80
80
- final String baseUrl = WicketUtils .getGitblitURL (getRequest ());
81
- final boolean showGraph = app ().settings ().getBoolean (Keys .web .showBranchGraph , true );
81
+ String baseUrl = WicketUtils .getGitblitURL (getRequest ());
82
+ boolean showGraph = app ().settings ().getBoolean (Keys .web .showBranchGraph , true );
82
83
83
84
MarkupContainer graph = new WebMarkupContainer ("graph" );
84
85
add (graph );
@@ -103,9 +104,13 @@ public LogPanel(String wicketId, final String repositoryName, final String objec
103
104
}
104
105
105
106
final int hashLen = app ().settings ().getInteger (Keys .web .shortCommitIdLength , 6 );
106
- final List <RepositoryCommit > repoCommits = new ArrayList <>(commits .size ());
107
+ List <RepositoryCommit > repoCommits = new ArrayList <>(commits .size ());
107
108
for (RevCommit c : commits ) {
108
- repoCommits .add (new RepositoryCommit (repositoryName , "" , c ));
109
+ RepositoryCommit repoCommit = new RepositoryCommit (repositoryName , "" , c );
110
+ if (allRefs .containsKey (c )) {
111
+ repoCommit .setRefs (allRefs .get (c ));
112
+ }
113
+ repoCommits .add (repoCommit );
109
114
}
110
115
ListDataProvider <RepositoryCommit > dp = new ListDataProvider <RepositoryCommit >(repoCommits );
111
116
DataView <RepositoryCommit > logView = new DataView <RepositoryCommit >("commit" , dp ) {
@@ -138,7 +143,7 @@ public void populateItem(final Item<RepositoryCommit> item) {
138
143
// short message
139
144
String shortMessage = entry .getShortMessage ();
140
145
String trimmedMessage = shortMessage ;
141
- if (allRefs . containsKey (entry .getId ())) {
146
+ if (! ArrayUtils . isEmpty (entry .getRefs ())) {
142
147
trimmedMessage = StringUtils .trimString (shortMessage , Constants .LEN_SHORTLOG_REFS );
143
148
} else {
144
149
trimmedMessage = StringUtils .trimString (shortMessage , Constants .LEN_SHORTLOG );
@@ -151,7 +156,7 @@ public void populateItem(final Item<RepositoryCommit> item) {
151
156
}
152
157
item .add (shortlog );
153
158
154
- item .add (new RefsPanel ("commitRefs" , repositoryName , allRefs . get ( entry .getId () )));
159
+ item .add (new RefsPanel ("commitRefs" , repositoryName , entry .getRefs ( )));
155
160
156
161
// commit hash link
157
162
LinkPanel commitHash = new LinkPanel ("hashLink" , null , entry .getName ().substring (0 , hashLen ),
0 commit comments