// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.
341247
func (s *Subscription) GetRepositoryURL() string {
	if s == nil || s.RepositoryURL == nil {
		return ""
	}
	return *s.RepositoryURL
}
1223561
func (p *PushEventRepository) GetGitURL() string {
	if p == nil || p.GitURL == nil {
		return ""
	}
	return *p.GitURL
}
807007
func (r *Repository) GetDeploymentsURL() string {
	if r == nil || r.DeploymentsURL == nil {
		return ""
	}
	return *r.DeploymentsURL
}
663890
func (g *Gist) GetGitPullURL() string {
	if g == nil || g.GitPullURL == nil {
		return ""
	}
	return *g.GitPullURL
}
667308
func (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch string) (_ *PullRequestInfo, err error) {
	var remoteBranch string

	// We don't need a temporary remote for same repository.
	if repo.Path != basePath {
		// Add a temporary remote
		tmpRemote := strconv.FormatInt(time.Now().UnixNano(), 10)
		if err = repo.AddRemote(tmpRemote, basePath, true); err != nil {
			return nil, fmt.Errorf("AddRemote: %v", err)
		}
		defer repo.RemoveRemote(tmpRemote)

		remoteBranch = "remotes/" + tmpRemote + "/" + baseBranch
	} else {
		remoteBranch = baseBranch
	}

	prInfo := new(PullRequestInfo)
	prInfo.MergeBase, err = repo.GetMergeBase(remoteBranch, headBranch)
	if err != nil {
		return nil, err
	}

	logs, err := NewCommand("log", prInfo.MergeBase+"..."+headBranch, _PRETTY_LOG_FORMAT).RunInDirBytes(repo.Path)
	if err != nil {
		return nil, err
	}
	prInfo.Commits, err = repo.parsePrettyFormatLogToList(logs)
	if err != nil {
		return nil, fmt.Errorf("parsePrettyFormatLogToList: %v", err)
	}

	// Count number of changed files.
	stdout, err := NewCommand("diff", "--name-only", remoteBranch+"..."+headBranch).RunInDir(repo.Path)
	if err != nil {
		return nil, err
	}
	prInfo.NumFiles = len(strings.Split(stdout, "\n")) - 1

	return prInfo, nil
}
151725
func (r *Repository) GetGitURL() string {
	if r == nil || r.GitURL == nil {
		return ""
	}
	return *r.GitURL
}
1062360
func (r *Repository) GetDownloadsURL() string {
	if r == nil || r.DownloadsURL == nil {
		return ""
	}
	return *r.DownloadsURL
}
1333434
func (r *RepositoryCommit) GetHTMLURL() string {
	if r == nil || r.HTMLURL == nil {
		return ""
	}
	return *r.HTMLURL
}
672974
func (r *Repository) GetArchiveURL() string {
	if r == nil || r.ArchiveURL == nil {
		return ""
	}
	return *r.ArchiveURL
}
381471
func (i *Installation) GetRepositorySelection() string {
	if i == nil || i.RepositorySelection == nil {
		return ""
	}
	return *i.RepositorySelection
}
1071284
func (p *RemoteProvider) GetServiceURL() url.URL {
	u := url.URL{
		Scheme: "https",
		Host:   p.Host,
		Path:   "/_ah/api/config/v1/",
	}
	if p.Insecure {
		u.Scheme = "http"
	}
	return u
}
1372542
func (c *connection) getRepositoryV1(name string) (repository, error) {
	klog.V(4).Infof("Getting repository %s from %s", name, c.url.String())

	base := c.url
	base.Path = path.Join(base.Path, fmt.Sprintf("/v1/repositories/%s/images", name))
	req, err := http.NewRequest("GET", base.String(), nil)
	if err != nil {
		return nil, fmt.Errorf("error creating request: %v", err)
	}
	req.Header.Add("X-Docker-Token", "true")
	resp, err := c.client.Do(req)
	if err != nil {
		// if we tried https and were rejected, try http
		if c.url.Scheme == "https" && c.allowInsecure {
			klog.V(4).Infof("Failed to get https, trying http: %v", err)
			c.url.Scheme = "http"
			return c.getRepositoryV1(name)
		}
		return nil, convertConnectionError(c.url.String(), fmt.Errorf("error getting X-Docker-Token from %s: %v", name, err))
	}
	defer resp.Body.Close()

	// if we were redirected, update the base urls
	c.url.Scheme = resp.Request.URL.Scheme
	c.url.Host = resp.Request.URL.Host

	switch code := resp.StatusCode; {
	case code == http.StatusNotFound:
		return nil, errRepositoryNotFound{name}
	case code >= 300 || resp.StatusCode < 200:
		return nil, fmt.Errorf("error retrieving repository: server returned %d", resp.StatusCode)
	}

	// TODO: select a random endpoint
	return &v1repository{
		name:     name,
		endpoint: url.URL{Scheme: c.url.Scheme, Host: resp.Header.Get("X-Docker-Endpoints")},
		token:    resp.Header.Get("X-Docker-Token"),
	}, nil
}
910172
func (c *Contributor) GetReposURL() string {
	if c == nil || c.ReposURL == nil {
		return ""
	}
	return *c.ReposURL
}
762636
func (r *RepositoryRelease) GetAssetsURL() string {
	if r == nil || r.AssetsURL == nil {
		return ""
	}
	return *r.AssetsURL
}
761358
func (r *RepositoryContent) GetDownloadURL() string {
	if r == nil || r.DownloadURL == nil {
		return ""
	}
	return *r.DownloadURL
}
1285983
func (r *RepositoryContent) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
711354
func (r *RepositoryInvitation) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}