Skip to content

Commit 675ac4c

Browse files
committed
Support changesets deleting branches at the same time as merging them to another branch
1 parent f1abdf0 commit 675ac4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/TfvcMigrator/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.CommandLine;
22
using System.CommandLine.NamingConventionBinder;
33
using System.Globalization;
4+
using System.Linq;
45
using System.Text;
56
using LibGit2Sharp;
67
using Microsoft.TeamFoundation.SourceControl.WebApi;
@@ -520,7 +521,8 @@ private static async IAsyncEnumerable<MappingState> EnumerateMappingStatesAsync(
520521
keySelector: mappingByBranch => mappingByBranch.Branch,
521522
dependenciesSelector: mappingByBranch => additionalParents
522523
.Where(b => b.Branch == mappingByBranch.Branch)
523-
.Select(b => b.ParentBranch))
524+
.Select(b => b.ParentBranch)
525+
.Where(branchMappings.ContainsKey)) // If the parent branch is also being deleted in the same commit, it doesn't affect the relative order
524526
.ToImmutableArray();
525527

526528
yield return new MappingState(

0 commit comments

Comments
 (0)