Fix redirect with non-ascii branch names (#4764) (#4810)

* Fix redirect with non-ascii branch names (#4764)

* Add integration tests for non-ascii branch redirect

* Fix mysql test and coverage test
This commit is contained in:
SagePtr 2018-09-07 03:37:02 +02:00 committed by techknowlogick
parent 13e8a0fe56
commit bf55276189
49 changed files with 786 additions and 8 deletions

View file

@ -74,3 +74,38 @@
type: 1
config: "{}"
created_unix: 1524304355
-
id: 12
repo_id: 33
type: 1
config: "{}"
created_unix: 1535593231
-
id: 13
repo_id: 33
type: 2
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
created_unix: 1535593231
-
id: 14
repo_id: 33
type: 3
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowSquash\":true}"
created_unix: 1535593231
-
id: 15
repo_id: 33
type: 4
config: "{}"
created_unix: 1535593231
-
id: 16
repo_id: 33
type: 5
config: "{}"
created_unix: 1535593231

View file

@ -400,3 +400,10 @@
num_forks: 0
num_issues: 0
is_mirror: false
-
id: 33
owner_id: 2
lower_name: utf8
name: utf8
is_private: false

View file

@ -27,7 +27,7 @@
is_admin: false
avatar: avatar2
avatar_email: user2@example.com
num_repos: 5
num_repos: 6
num_stars: 2
num_followers: 2
num_following: 1

View file

@ -147,10 +147,10 @@ func TestSearchRepositoryByName(t *testing.T) {
count: 14},
{name: "AllPublic/PublicRepositoriesOfUserIncludingCollaborative",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, AllPublic: true},
count: 16},
count: 17},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true},
count: 20},
count: 21},
{name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName",
opts: &SearchRepoOptions{Keyword: "test", Page: 1, PageSize: 10, OwnerID: 15, Private: true, AllPublic: true},
count: 13},
@ -159,7 +159,7 @@ func TestSearchRepositoryByName(t *testing.T) {
count: 11},
{name: "AllPublic/PublicRepositoriesOfOrganization",
opts: &SearchRepoOptions{Page: 1, PageSize: 10, OwnerID: 17, AllPublic: true, Collaborate: util.OptionalBoolFalse},
count: 16},
count: 17},
}
for _, testCase := range testCases {