leonardochaia/dotnet-affected

Text file contains duplicated projects

bartlomiejgawel opened this issue · 0 comments

Hello,

First of all, thank you so much for this truly amazing tool!

I've noticed that a text file contains duplicated projects.

Here you can find a sample reproduction:
https://github.com/bartlomiejgawel/dotnet-affected-bug

You can clone it and run the following command:

dotnet affected --from b4d7eab --to 71b0a49 --format text traversal --dry-run

Expected behaviour: I expected that both files will contain the same number of affected projects (3) but only the proj file met my expectations. The text file contained 4 affected projects (DotnetAffected.FirstApp.csproj was duplicated).

Actual behaviour: You can see that the text file contains a duplicated project (DotnetAffected.FirstApp.csproj) comparing to the proj file:

DRY-RUN: WRITE affected.txt
DRY-RUN: CONTENTS:
DotnetAffected\DotnetAffected.FirstApp\DotnetAffected.FirstApp.csproj
DotnetAffected\DotnetAffected.Library\DotnetAffected.Library.csproj
DotnetAffected\DotnetAffected.FirstApp\DotnetAffected.FirstApp.csproj
DotnetAffected\DotnetAffected.SecondApp\DotnetAffected.SecondApp.csproj

DRY-RUN: WRITE affected.proj
DRY-RUN: CONTENTS:
<Project Sdk="Microsoft.Build.Traversal/3.0.3">
  <ItemGroup>
    <ProjectReference Include="DotnetAffected\DotnetAffected.FirstApp\DotnetAffected.FirstApp.csproj" />
    <ProjectReference Include="DotnetAffected\DotnetAffected.Library\DotnetAffected.Library.csproj" />
    <ProjectReference Include="DotnetAffected\DotnetAffected.SecondApp\DotnetAffected.SecondApp.csproj" />
  </ItemGroup>
</Project>

dotnet-affected version: 2.2.0