mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-01 05:37:55 +00:00
Gitea use default branch (#480)
instead of hard-coded default branch use what gitea tell us
This commit is contained in:
@@ -47,7 +47,7 @@ func toRepo(from *gitea.Repository, privateMode bool) *model.Repo {
|
|||||||
Link: from.HTMLURL,
|
Link: from.HTMLURL,
|
||||||
IsPrivate: private,
|
IsPrivate: private,
|
||||||
Clone: from.CloneURL,
|
Clone: from.CloneURL,
|
||||||
Branch: "master",
|
Branch: from.DefaultBranch,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -206,6 +206,7 @@ func Test_parse(t *testing.T) {
|
|||||||
CloneURL: "http://gitea.golang.org/gophers/hello-world.git",
|
CloneURL: "http://gitea.golang.org/gophers/hello-world.git",
|
||||||
HTMLURL: "http://gitea.golang.org/gophers/hello-world",
|
HTMLURL: "http://gitea.golang.org/gophers/hello-world",
|
||||||
Private: true,
|
Private: true,
|
||||||
|
DefaultBranch: "master",
|
||||||
}
|
}
|
||||||
repo := toRepo(&from, false)
|
repo := toRepo(&from, false)
|
||||||
g.Assert(repo.FullName).Equal(from.FullName)
|
g.Assert(repo.FullName).Equal(from.FullName)
|
||||||
|
Reference in New Issue
Block a user