Skip to content

Commit 4eca51d

Browse files
author
Stewart Miles
committed
Improved VH manifest alias tracking for packages without aliases.
I5c459bb092666088c3eedb33155bf06df75b6285 added an empty set of aliases to all manifests including those that are actually aliases this had the side effect of breaking the alias graph traversal. This patch only adds an empty set of aliases to manifests who are not aliases of other manifests. Change-Id: I83a195c7f17864f0ce01e7e7a99d717ddeb631ce
1 parent 0b9cd5c commit 4eca51d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

source/VersionHandlerImpl/src/VersionHandlerImpl.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,12 +1429,27 @@ private Dictionary<string, HashSet<string>> GetManifestAliasesByName() {
14291429
}
14301430
aliases.Add(metadata.customManifestNames.Values[0]);
14311431
}
1432+
}
1433+
}
1434+
// If manifest isn't an alias and doesn't have any aliases store an empty set.
1435+
foreach (var metadataByVersion in Values) {
1436+
var metadata = metadataByVersion.MostRecentVersion;
1437+
if (metadata.isManifest) {
1438+
var manifestName = metadata.ManifestName;
1439+
bool found = false;
1440+
foreach (var kv in aliasesByName) {
1441+
if (kv.Key == manifestName || kv.Value.Contains(manifestName)) {
1442+
found = true;
1443+
break;
1444+
}
1445+
}
14321446
// If there are no aliases, store an empty set.
1433-
if (metadata.customManifestNames.Values.Count == 0) {
1447+
if (!found) {
14341448
aliasesByName[metadata.ManifestName] = new HashSet<string>();
14351449
}
14361450
}
14371451
}
1452+
14381453
// Display adjacency list for debugging.
14391454
var logLines = new List<string>();
14401455
foreach (var nameAndAliases in aliasesByName) {

0 commit comments

Comments
 (0)