1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-02-04 18:21:06 +02:00

Gitea use default branch (#480)

instead of hard-coded default branch use what gitea tell us
This commit is contained in:
Anbraten 2021-10-27 00:37:01 +02:00 committed by GitHub
parent 3c5827f08a
commit 63a93087a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -47,7 +47,7 @@ func toRepo(from *gitea.Repository, privateMode bool) *model.Repo {
Link: from.HTMLURL,
IsPrivate: private,
Clone: from.CloneURL,
Branch: "master",
Branch: from.DefaultBranch,
}
}

View File

@ -206,6 +206,7 @@ func Test_parse(t *testing.T) {
CloneURL: "http://gitea.golang.org/gophers/hello-world.git",
HTMLURL: "http://gitea.golang.org/gophers/hello-world",
Private: true,
DefaultBranch: "master",
}
repo := toRepo(&from, false)
g.Assert(repo.FullName).Equal(from.FullName)