Skip to content

Fails when TeamCity VCS Root config "Use tags as branches" is set #32

Open
@RobSmyth

Description

@RobSmyth

Describe the bug

When a TeamCity build configuration's VCS Root uses the option "Use tags as branches" a compile time exception is thrown:

Git2SemVerGitOperationException: Unable to read branch name from Git status response '## HEAD (no branch)

Build fails.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Build succeeds.

Version (please complete the following information):

  • Git2SemVer.MSBuild version: 1.1.0

Environment (please complete the following information):

  • Local TeamCity

Additional context

TeamCity build: 509 (local)

From Git2SemVer.Build.log:

TRACE|Running '/usr/bin/git status -b -s --porcelain'.
ERROR|Exception - Unable to read branch name from Git status response '## HEAD (no branch)
?? teamcity.logger.9e11092f10844b3998fa0406f2292a9b/
'.

Stack trace: at NoeticTools.Common.Tools.Git.GitTool.ParseStatusResponseBranchName(String stdOutput)
at NoeticTools.Common.Tools.Git.GitTool.GetBranchName()
at NoeticTools.Common.Tools.Git.GitTool..ctor(ILogger logger)
at NoeticTools.Git2SemVer.MSBuild.Versioning.ProjectVersioningFactory.Create(IVersionGeneratorInputs inputs)
at NoeticTools.Git2SemVer.MSBuild.Tasks.Git2SemVerGenerateVersionTask.Execute()

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