Skip to content

Commit

Permalink
Use two different error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLarsson committed Mar 19, 2024
1 parent 359ac31 commit 7349227
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/TfvcMigrator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ private static RootPathChange ParseRootPathChange(string token)

foreach (var (_, parentChangeset, parentBranch) in mappingState.AdditionalParents.Where(t => t.Branch == branch))
{
if (commitsByChangeset.TryGetValue(parentChangeset, out var createdChangesets)
&& createdChangesets.SingleOrDefault(c => c.Branch == parentBranch).Commit is { } commit)
if (commitsByChangeset.TryGetValue(parentChangeset, out var createdChangesets))
{
parents.Add(commit);
if (createdChangesets.SingleOrDefault(c => c.Branch == parentBranch).Commit is { } commit)
{
parents.Add(commit);
}
else
{
throw new InvalidOperationException("Should not be reachable. Should be a single changeset matching parent branch.");
}
}
else
{
Expand Down

0 comments on commit 7349227

Please sign in to comment.