Skip to content

Export map can't be created, if a TFS changeset shall be assigned to multiple commits #1469

@cdrfun

Description

@cdrfun

When I try to create a mapping using git tfs exportmap -f mapping.txt I get the following error.

2023-09-07 14:07:28.0607 [Debug] git-tfs version 0.32.0.0 (TFS client library 16.0.0.0 (MS)) (64-bit)
2023-09-07 14:07:28.1457 [Debug] System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.
   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   bei GitTfs.Core.GitRepository.GetCommitChangeSetPairs() in C:\gittfs\src\GitTfs\Core\GitRepository.cs:Zeile 812.
   bei GitTfs.Commands.ExportMap.Run() in C:\gittfs\src\GitTfs\Commands\ExportMap.cs:Zeile 45.
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei GitTfs.Util.GitTfsCommandRunner.Run(GitTfsCommand command, IList`1 args) in C:\gittfs\src\GitTfs\Util\GitTfsCommandRunner.cs:Zeile 36.
   bei GitTfs.GitTfs.Main(GitTfsCommand command, IList`1 unparsedArgs) in C:\gittfs\src\GitTfs\GitTfs.cs:Zeile 83.
   bei GitTfs.GitTfs.Run(IList`1 args) in C:\gittfs\src\GitTfs\GitTfs.cs:Zeile 48.
   bei GitTfs.Program.Main(String[] args) in C:\gittfs\src\GitTfs\Program.cs:Zeile 28.
2023-09-07 14:07:28.1457 [Error] Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.

After some investigation I found this is due to a TFS changeset which was used to save changes to multiple branches. We now have one changeset which shall be assigned to multiple commits, which is not allowed by the underlying dictionary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions