File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
site/src/request_handlers Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11use collector:: Bound ;
2+ use database:: CommitType ;
23use std:: collections:: HashMap ;
34use std:: sync:: Arc ;
45
@@ -140,9 +141,19 @@ async fn create_graphs(
140141 } ) )
141142}
142143
144+ /// Returns artifact IDs for the given range.
145+ /// Inside of the range (not at the start/end), only master commits are kept.
143146fn artifact_ids_for_range ( ctxt : & SiteCtxt , start : Bound , end : Bound ) -> Vec < ArtifactId > {
144147 let range = ctxt. data_range ( start..=end) ;
145- range. into_iter ( ) . map ( |c| c. into ( ) ) . collect ( )
148+ let count = range. len ( ) ;
149+ range
150+ . into_iter ( )
151+ . enumerate ( )
152+ . filter ( |( index, commit) | {
153+ * index == 0 || * index == count - 1 || matches ! ( commit. r#type, CommitType :: Master )
154+ } )
155+ . map ( |c| c. 1 . into ( ) )
156+ . collect ( )
146157}
147158
148159/// Creates a summary "benchmark" that averages the results of all other
You can’t perform that action at this time.
0 commit comments