Remove default branch fallbacks (#2065)

This commit is contained in:
Anbraten
2023-07-30 18:28:52 +02:00
committed by GitHub
parent 4731eeb5db
commit 5a812e3254
6 changed files with 19 additions and 34 deletions

View File

@@ -53,10 +53,6 @@ func (g *GitLab) convertGitLabRepo(_repo *gitlab.Project) (*model.Repo, error) {
},
}
if len(repo.Branch) == 0 { // TODO: do we need that?
repo.Branch = "master"
}
if len(repo.Avatar) != 0 && !strings.HasPrefix(repo.Avatar, "http") {
repo.Avatar = fmt.Sprintf("%s/%s", g.url, repo.Avatar)
}
@@ -101,11 +97,7 @@ func convertMergeRequestHook(hook *gitlab.MergeEvent, req *http.Request) (int, *
repo.Clone = target.HTTPURL
}
if target.DefaultBranch != "" {
repo.Branch = target.DefaultBranch
} else {
repo.Branch = "master"
}
repo.Branch = target.DefaultBranch
if target.AvatarURL != "" {
repo.Avatar = target.AvatarURL