Explorer

core.project-branches-from

description
Adds to branches the branches of the commits from index that are not in it yet (core.project-branches)
type
Fn(commits: List<@core.commit-summary>, index: Number, branches: List<@core.branch-summary>) -> List<@core.branch-summary>
expression
fn(commits$0, index$1, branches$2) =>
  match @core.list-get(list: $0, index: $1) {
    #none(_) =>
      $2,
    #some(item$1008) =>
      let commit$3 = $1008;
      let project_name$4 = $3.project_name;
      let branch$5 = $3.branch;
      @core.project-branches-from(
        commits: $0,
        index: @core.plus(left: $1, right: 1),
        branches: match @core.branch-summaries-have(branches: $2, project_name: $4, branch: $5, index: 0) {
          true =>
            $2,
          false =>
            match @core.branch-first-commit(commits: $0, project_name: $4, branch: $5, index: $1, found: #none) {
              #none(_) =>
                $2,
              #some(first$6) =>
                match @core.branch-latest-commit(commits: $0, project_name: $4, branch: $5, index: $1, found: #none) {
                  #none(_) =>
                    $2,
                  #some(latest$7) =>
                    @core.list-append(
                      list: $2,
                      item: {
                        project_name: $4,
                        name: $5,
                        creator_account_id: $6.account_id,
                        latest_event_hash: $7.event_hash,
                        latest_time: $7.time,
                        commit_count: @core.branch-commit-count(commits: $0, project_name: $4, branch: $5, index: $1, count: 0)
                      }
                    )
                }
            }
        }
      )
  }
visibility
public
core.project-branches-from (project definy, branch compiled-tests, snapshot i6TqClmqVS9FK8rKOvJ43l6Tevx8pvYJ5-zaQqNwemc)
id: i31dYsagFS0ESDYmod1RDC_x1yEeXL1JFZdkKCUkHLs
content hash: Vw1f72D3zzxkCR6KGl_yLhsFQoUHHtnkuzDJ63CewMc