untouch unrelated

This commit is contained in:
6543 2023-02-14 03:23:11 +01:00
parent c5040b622d
commit d7d853e3e6
No known key found for this signature in database
GPG Key ID: B8BE6D610E61C862

View File

@ -11,6 +11,8 @@ import (
// lookupCacheTimeout specifies the timeout for the DNS lookup cache.
var lookupCacheTimeout = 15 * time.Minute
var defaultPagesRepo = "pages"
// GetTargetFromDNS searches for CNAME or TXT entries on the request domain ending with MainDomainSuffix.
// If everything is fine, it returns the target data.
func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLookupCache cache.SetGetKey) (targetOwner, targetRepo, targetBranch string) {
@ -50,9 +52,9 @@ func GetTargetFromDNS(domain, mainDomainSuffix, firstDefaultBranch string, dnsLo
targetBranch = cnameParts[len(cnameParts)-3]
}
if targetRepo == "" {
targetRepo = firstDefaultBranch
targetRepo = defaultPagesRepo
}
if targetBranch == "" && targetRepo != firstDefaultBranch {
if targetBranch == "" && targetRepo != defaultPagesRepo {
targetBranch = firstDefaultBranch
}
// if targetBranch is still empty, the caller must find the default branch