Bladeren bron

Fix in the DOI discovery logic

Was returning first tag found, not the latest.  This would likely be the
latest, since tags appear to be discovered in reverse chronological
order, but I don't think this is guaranteed, so checking times is more
reliable.
Achilleas Koutsou 5 jaren geleden
bovenliggende
commit
492b52bbd0
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      internal/context/context_gin.go

+ 1 - 1
internal/context/context_gin.go

@@ -75,9 +75,9 @@ func getRepoDOI(c *Context) string {
 					latestTag = tagName
 					latestTag = tagName
 					latestTime = commitTime
 					latestTime = commitTime
 				}
 				}
-				return latestTag
 			}
 			}
 		}
 		}
+		return latestTag
 	} else {
 	} else {
 		// this shouldn't happen even if there are no tags
 		// this shouldn't happen even if there are no tags
 		// log the error, but fall back to the old method anyway
 		// log the error, but fall back to the old method anyway