Update pseudo-version script to determine future release version based on branch name

This commit is contained in:
Malte Poll 2022-08-19 15:55:44 +02:00 committed by Malte Poll
parent fdcdd5fb78
commit 2d87db3914
4 changed files with 57 additions and 34 deletions

View file

@ -100,6 +100,14 @@ func (g *Git) ParsedBranchName() (string, error) {
return strings.TrimSuffix(branch, "-"), nil
}
func (g *Git) BranchName() (string, error) {
commitRef, err := g.repo.Head()
if err != nil {
return "", err
}
return commitRef.Name().Short(), nil
}
// tagsByRevisionHash returns a map from revision hash to a list of associated tags.
func (g *Git) tagsByRevisionHash() (map[string][]string, error) {
tags := make(map[string][]string)