Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThisAssembly.Git.IsDirty is included when GitThisAssembly is false #337

Closed
gitfool opened this issue May 7, 2024 · 1 comment · Fixed by #338
Closed

ThisAssembly.Git.IsDirty is included when GitThisAssembly is false #337

gitfool opened this issue May 7, 2024 · 1 comment · Fixed by #338
Assignees
Labels

Comments

@gitfool
Copy link
Contributor

gitfool commented May 7, 2024

Describe the Bug

If I disable GitThisAssembly and build with GitInfo then it still includes the ThisAssembly class, albeit with just the Git class and its IsDirty constant.

Steps to Reproduce

Create a new library, add the GitInfo package reference and disable GitThisAssembly:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="GitInfo" Version="3.3.4" PrivateAssets="All" />
  </ItemGroup>

  <PropertyGroup>
    <GitThisAssembly>false</GitThisAssembly>
  </PropertyGroup>
</Project>

Build the project and look at the assembly with JetBrains dotPeek:

image

Expected Behavior

The ThisAssembly class should be completely excluded from the assembly output.

Additional Info

The class seems to be coming from https://github.com/devlooped/GitInfo/blob/main/src/Analyzer/GitInfoGenerator.cs.

@gitfool gitfool added the bug label May 7, 2024
@gitfool gitfool changed the title GitThisAssembly.Git.IsDirty is included when GitThisAssembly=false ThisAssembly.Git.IsDirty is included when GitThisAssembly is false May 7, 2024
kzu added a commit that referenced this issue May 8, 2024
We missed checking this in the source-generator.

Fixes #337
@kzu kzu self-assigned this May 8, 2024
@kzu
Copy link
Member

kzu commented May 8, 2024

Thanks for the clear repro steps and looking into the culprit code. A fix is shipping in a bit.

@kzu kzu closed this as completed in #338 May 8, 2024
kzu added a commit that referenced this issue May 8, 2024
We missed checking this in the source-generator.

Fixes #337
@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants