A late merge is named however its modules read since the cut; a walk builds the commits it carries (hq ADR 0276 review)
This commit is contained in:
@@ -94,6 +94,21 @@ func (p Plan) CommitOf(repository string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// CommitOn is the commit of a repository's branch the walk carries; empty when it carries none of it. A
|
||||
// commit kept without its branch matches any branch.
|
||||
func (p Plan) CommitOn(repository, branch string) string {
|
||||
for _, c := range p.Commits {
|
||||
if strings.EqualFold(c.Repository, repository) && (branch == "" || c.Branch == "" || c.Branch == branch) {
|
||||
return c.Commit
|
||||
}
|
||||
}
|
||||
if len(p.Commits) == 0 && strings.EqualFold(p.Repository, repository) &&
|
||||
(branch == "" || p.Branch == "" || p.Branch == branch) {
|
||||
return p.Commit
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Carried is every repository's commit the walk carries: Commits, or its one repository and commit.
|
||||
func (p Plan) Carried() []PlanCommit {
|
||||
if len(p.Commits) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user