From 193d52449391954d95ad2a316296f4972aaa2a0f Mon Sep 17 00:00:00 2001 From: Kirilll Zaycev Date: Mon, 1 Feb 2016 02:22:44 +0300 Subject: [PATCH] Ensure we add avatar when activate repo --- remote/gitlab/gitlab.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/remote/gitlab/gitlab.go b/remote/gitlab/gitlab.go index faf473c95..79471911e 100644 --- a/remote/gitlab/gitlab.go +++ b/remote/gitlab/gitlab.go @@ -145,6 +145,12 @@ func (g *Gitlab) Repo(u *model.User, owner, name string) (*model.Repo, error) { repo.Clone = repo_.HttpRepoUrl repo.Branch = "master" + repo.Avatar = repo_.AvatarUrl + + if len(repo.Avatar) != 0 && !strings.HasPrefix(repo.Avatar, "http") { + repo.Avatar = fmt.Sprintf("%s/%s", g.URL, repo.Avatar) + } + if repo_.DefaultBranch != "" { repo.Branch = repo_.DefaultBranch }