Help us shape the future of Go! Take the 2026 Go Developer Survey

match

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package match implements branch matching

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRefForRepo

func GetRefForRepo(ri RepoInfo, branches []BranchInfo) (sha string, branch string, err error)

GetRefForRepo contains the core branch matching algorithm. The input is data about the triggering repository/PR and the extant branches for the repo in question. Output is the branch and SHA to use for the repo

Types

type BranchInfo

type BranchInfo struct {
	Name string
	SHA  string
}

BranchInfo includes the information about a specific branch of a git repo

type RefMap

type RefMap map[string]BranchInfo

RefMap is a map of repository name to the ref (branch/sha) to use for that repo

func (RefMap) CommitSHAMap

func (rm RefMap) CommitSHAMap() map[string]string

CommitSHAMap returns a map that can be cast to models.CommitSHAMap

func (RefMap) RefMap

func (rm RefMap) RefMap() map[string]string

RefMap returns a map that can be cast to models.RefMap

type RepoInfo

type RepoInfo struct {
	SourceBranch  string
	BaseBranch    string
	BranchMatch   bool
	DefaultBranch string
}

RepoInfo models the information about parent (triggered) repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL