Skip to content

[Bug] Build fail when building a detached head #2697

@Evangelink

Description

@Evangelink

Describe the bug

I have setup my projects to use GitVersions and as soon as I try to build a commit from history (detached head), build fails with

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB3073	The command ""C:\Users\XXX\.nuget\packages\gitversion.msbuild\5.6.9\tools\net48/gitversion.exe" "C:\Src\YYY" -output file -outputfile obj\gitversion.json" exited with code 1.	YYY	C:\Users\XXX\.nuget\packages\gitversion.msbuild\5.6.9\tools\GitVersion.MsBuild.targets	9	

Expected Behavior

I should be able to get back to any commit and simply build my solution.

Actual Behavior

Build fails, I have to comment the nuget from all my projects and rebuild.

Steps to Reproduce

  1. Create a simple project
  2. Add GitVersion.MsBuild
  3. Commit some code
  4. Commit something else
  5. Get back to previous commit
  6. Build the solution, the solution fails

My GitVersion.yml:

assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
next-version: 1.0.0
branches: {}
ignore:
  sha: []
merge-message-formats: {}

Context

I am trying to see on which commit a bug was introduced.

Your Environment

  • Version Used: 5.6.9
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions