Ensure we add avatar when activate repo

This commit is contained in:
Kirilll Zaycev 2016-02-01 02:22:44 +03:00
parent 1dbefc5281
commit 193d524493

View file

@ -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
}