5b1c3cb6e7ce60e71edfb9e7237eca2fe7a02910
braney
  Wed Apr 18 15:45:25 2018 -0700
fixed bug  #21294 by re-introducing some code that checks to see if a
name has already been used before appending some uniqueifying  text

diff --git src/hg/hgCollection/hgCollection.c src/hg/hgCollection/hgCollection.c
index a58bfd7..1960bdb 100644
--- src/hg/hgCollection/hgCollection.c
+++ src/hg/hgCollection/hgCollection.c
@@ -67,30 +67,37 @@
     safef(buffer, sizeof buffer, "%s (%d)", label, count);
     if (hashLookup(labelHash, buffer) == NULL)
         {
         hashStore(labelHash, buffer);
         return cloneString(buffer);
         }
     }
 
 return NULL;
 }
 
 static char *makeUniqueName(struct hash *nameHash, char *name)
 // Make the name of this track unique.
 {
 char *skipHub = trackHubSkipHubName(name);
+
+if (hashLookup(nameHash, skipHub) == NULL)
+    {
+    hashStore(nameHash, skipHub);
+    return skipHub;
+    }
+
 char base[4096];
 safef(base, sizeof base, "%s_%lx",skipHub, time(NULL) - 1520629086);
 
 unsigned count = 0;
 char buffer[4096];
 
 for(;; count++)
     {
     safef(buffer, sizeof buffer, "%s%d", base, count);
     if (hashLookup(nameHash, buffer) == NULL)
         {
         hashStore(nameHash, buffer);
         return cloneString(buffer);
         }
     }