Skip to content

Commit

Permalink
Replace / and \ in branches with dashes
Browse files Browse the repository at this point in the history
Do this only when setting a default Version since otherwise the build fails. But we don't want to change the determined GitBranch so it remains accurate.

Closes #244.
  • Loading branch information
kzu authored Feb 21, 2023
1 parent dffafc7 commit b50ac9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitInfo/build/GitInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@

<Target Name="GitSetVersion" DependsOnTargets="GitVersion" Condition="'$(GitVersion)' != 'false'">
<PropertyGroup>
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$(GitBranch).$(GitCommit)</Version>
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$(GitBranch.Replace('/', '-').Replace('\', '-')).$(GitCommit)</Version>
<PackageVersion>$(Version)</PackageVersion>
</PropertyGroup>
</Target>
Expand Down

0 comments on commit b50ac9f

Please sign in to comment.