Skip to content

Bug: Branch contains / is not replaced by - in build metadata #1520

@melcloud

Description

@melcloud

GitVersion version: 4.0, 3.6.4
Problem:
Given a branch name contains /, e.g. hotfixes/build-script, the build metadata does not convert it to hyphen. This is not a valid semver 2.

{
  "Major":0,
  "Minor":2,
  "Patch":1,
  "PreReleaseTag":"beta.1",
  "PreReleaseTagWithDash":"-beta.1",
  "PreReleaseLabel":"beta",
  "PreReleaseNumber":1,
  "BuildMetaData":11,
  "BuildMetaDataPadded":"0011",
  "FullBuildMetaData":"11.Branch.hotfixes/build-script.Sha.301ff2de375da97133ab544c9561cbd909039877",
  "MajorMinorPatch":"0.2.1",
  "SemVer":"0.2.1-beta.1",
  "LegacySemVer":"0.2.1-beta1",
  "LegacySemVerPadded":"0.2.1-beta0001",
  "AssemblySemVer":"0.2.1.1",
  "FullSemVer":"0.2.1-beta.1+11",
  "InformationalVersion":"0.2.1-beta.1+11.Branch.hotfixes/build-script.Sha.301ff2de375da97133ab544c9561cbd909039877",
  "BranchName":"hotfixes/build-script",
  "Sha":"301ff2de375da97133ab544c9561cbd909039877",
  "NuGetVersionV2":"0.2.1-beta0001",
  "NuGetVersion":"0.2.1-beta0001",
  "CommitsSinceVersionSource":11,
  "CommitsSinceVersionSourcePadded":"0011",
  "CommitDate":"2018-10-31"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions