Skip to content

Commit

Permalink
Gitea use default branch (#480) (#482)
Browse files Browse the repository at this point in the history
instead of hard-coded default branch use what gitea tell us

Co-authored-by: Anbraten <anton@ju60.de>
  • Loading branch information
6543 and anbraten committed Oct 26, 2021
1 parent 3af5f99 commit dff4491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion remote/gitea/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func toRepo(from *gitea.Repository, privateMode bool) *model.Repo {
Link: from.HTMLURL,
IsPrivate: private,
Clone: from.CloneURL,
Branch: "master",
Branch: from.DefaultBranch,
}
}

Expand Down
7 changes: 4 additions & 3 deletions remote/gitea/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ func Test_parse(t *testing.T) {
UserName: "gordon",
AvatarURL: "http://1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87",
},
CloneURL: "http://gitea.golang.org/gophers/hello-world.git",
HTMLURL: "http://gitea.golang.org/gophers/hello-world",
Private: true,
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)
Expand Down

0 comments on commit dff4491

Please sign in to comment.