diff --git a/Vss2Git/VssPathMapper.cs b/Vss2Git/VssPathMapper.cs index f3e2204..1172cc3 100755 --- a/Vss2Git/VssPathMapper.cs +++ b/Vss2Git/VssPathMapper.cs @@ -547,10 +547,9 @@ public VssProjectInfo MoveProjectTo(VssItemName project, VssItemName subproject, subprojectInfo.Parent = parentInfo; } } - else + else if (IsInMappedSet(newParentSpec)) { // if resolution fails, the target project has been destroyed - // or is outside the set of projects being mapped subprojectInfo.Destroyed = true; } } @@ -585,6 +584,24 @@ private VssFileInfo GetOrCreateFile(VssItemName name) return fileInfo; } + private bool IsInMappedSet(string projectSpec) + { + if (!projectSpec.StartsWith("$/")) + { + throw new ArgumentException("Project spec must start with $/", "projectSpec"); + } + + foreach (var rootInfo in rootInfos.Values) + { + if (projectSpec.StartsWith(rootInfo.OriginalVssPath)) + { + return true; + } + } + + return false; + } + private VssProjectInfo ResolveProjectSpec(string projectSpec) { if (!projectSpec.StartsWith("$/"))