mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-01-20 16:50:28 -05:00
Compare commits
7 commits
06e3b35e46
...
249ac85383
Author | SHA1 | Date | |
---|---|---|---|
|
249ac85383 | ||
|
aa986ef1a6 | ||
|
0379739ac9 | ||
|
5be7c6cbd8 | ||
|
3d3ffaf5cb | ||
|
7ea62c5ce4 | ||
|
276ef10dd5 |
30 changed files with 135 additions and 61 deletions
2
Makefile
2
Makefile
|
@ -49,7 +49,7 @@ GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1 # renovate: datasour
|
|||
DEADCODE_PACKAGE ?= golang.org/x/tools/cmd/deadcode@v0.29.0 # renovate: datasource=go
|
||||
GOMOCK_PACKAGE ?= go.uber.org/mock/mockgen@v0.4.0 # renovate: datasource=go
|
||||
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.17.1 # renovate: datasource=go
|
||||
RENOVATE_NPM_PACKAGE ?= renovate@39.115.4 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
|
||||
RENOVATE_NPM_PACKAGE ?= renovate@39.118.1 # renovate: datasource=docker packageName=data.forgejo.org/renovate/renovate
|
||||
|
||||
# https://github.com/disposable-email-domains/disposable-email-domains/commits/main/
|
||||
DISPOSABLE_EMAILS_SHA ?= 0c27e671231d27cf66370034d7f6818037416989 # renovate: ...
|
||||
|
|
|
@ -14,4 +14,5 @@ type Repository struct {
|
|||
CloneURL string `yaml:"clone_url"` // SECURITY: This must be checked to ensure that is safe to be used
|
||||
OriginalURL string `yaml:"original_url"`
|
||||
DefaultBranch string
|
||||
Website string
|
||||
}
|
||||
|
|
|
@ -128,6 +128,7 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
|
|||
"comments": opts.Comments,
|
||||
"pulls": opts.PullRequests,
|
||||
"assets": opts.ReleaseAssets,
|
||||
"website": repo.Website,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -160,6 +160,7 @@ func (g *GiteaDownloader) GetRepoInfo() (*base.Repository, error) {
|
|||
CloneURL: repo.CloneURL,
|
||||
OriginalURL: repo.HTMLURL,
|
||||
DefaultBranch: repo.DefaultBranch,
|
||||
Website: repo.Website,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
|||
CloneURL: server.URL + "/gitea/test_repo.git",
|
||||
OriginalURL: server.URL + "/gitea/test_repo",
|
||||
DefaultBranch: "master",
|
||||
Website: "https://codeberg.org/forgejo/forgejo/",
|
||||
}, repo)
|
||||
|
||||
topics, err := downloader.GetTopics()
|
||||
|
|
|
@ -105,6 +105,7 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate
|
|||
r, err = repo_service.CreateRepositoryDirectly(g.ctx, g.doer, owner, repo_service.CreateRepoOptions{
|
||||
Name: g.repoName,
|
||||
Description: repo.Description,
|
||||
Website: repo.Website,
|
||||
OriginalURL: repo.OriginalURL,
|
||||
GitServiceType: opts.GitServiceType,
|
||||
IsPrivate: opts.Private || setting.Repository.ForcePrivate,
|
||||
|
@ -119,20 +120,17 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate
|
|||
}
|
||||
r.DefaultBranch = repo.DefaultBranch
|
||||
r.Description = repo.Description
|
||||
r.Website = repo.Website
|
||||
|
||||
r, err = repo_service.MigrateRepositoryGitData(g.ctx, owner, r, base.MigrateOptions{
|
||||
RepoName: g.repoName,
|
||||
Description: repo.Description,
|
||||
OriginalURL: repo.OriginalURL,
|
||||
GitServiceType: opts.GitServiceType,
|
||||
Mirror: repo.IsMirror,
|
||||
CloneAddr: repo.CloneURL, // SECURITY: we will assume that this has already been checked
|
||||
LFS: opts.LFS,
|
||||
LFSEndpoint: opts.LFSEndpoint,
|
||||
CloneAddr: repo.CloneURL, // SECURITY: we will assume that this has already been checked
|
||||
Private: repo.IsPrivate,
|
||||
Wiki: opts.Wiki,
|
||||
Releases: opts.Releases, // if didn't get releases, then sync them from tags
|
||||
Mirror: repo.IsMirror,
|
||||
MirrorInterval: opts.MirrorInterval,
|
||||
Releases: opts.Releases, // if didn't get releases, then sync them from tags
|
||||
RepoName: g.repoName,
|
||||
Wiki: opts.Wiki,
|
||||
}, NewMigrationHTTPTransport())
|
||||
|
||||
g.sameApp = strings.HasPrefix(repo.OriginalURL, setting.AppURL)
|
||||
|
|
|
@ -220,6 +220,7 @@ func (g *GithubDownloaderV3) GetRepoInfo() (*base.Repository, error) {
|
|||
OriginalURL: gr.GetHTMLURL(),
|
||||
CloneURL: gr.GetCloneURL(),
|
||||
DefaultBranch: gr.GetDefaultBranch(),
|
||||
Website: gr.GetHomepage(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ func TestGitHubDownloadRepo(t *testing.T) {
|
|||
CloneURL: server.URL + "/go-gitea/test_repo.git",
|
||||
OriginalURL: server.URL + "/go-gitea/test_repo",
|
||||
DefaultBranch: "master",
|
||||
Website: "https://codeberg.org/forgejo/forgejo/",
|
||||
}, repo)
|
||||
|
||||
topics, err := downloader.GetTopics()
|
||||
|
|
|
@ -151,6 +151,7 @@ func (g *GogsDownloader) GetRepoInfo() (*base.Repository, error) {
|
|||
CloneURL: gr.CloneURL,
|
||||
OriginalURL: gr.HTMLURL,
|
||||
DefaultBranch: gr.DefaultBranch,
|
||||
Website: gr.Website,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ func assertRepositoryEqual(t *testing.T, expected, actual *base.Repository) {
|
|||
assert.Equal(t, expected.CloneURL, actual.CloneURL)
|
||||
assert.Equal(t, expected.OriginalURL, actual.OriginalURL)
|
||||
assert.Equal(t, expected.DefaultBranch, actual.DefaultBranch)
|
||||
assert.Equal(t, expected.Website, actual.Website)
|
||||
}
|
||||
|
||||
func assertReviewEqual(t *testing.T, expected, actual *base.Review) {
|
||||
|
|
|
@ -85,6 +85,7 @@ func (r *RepositoryRestorer) GetRepoInfo() (*base.Repository, error) {
|
|||
OriginalURL: opts["original_url"],
|
||||
CloneURL: filepath.Join(r.baseDir, "git"),
|
||||
DefaultBranch: opts["default_branch"],
|
||||
Website: opts["website"],
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -4,4 +4,4 @@ Cache-Control: max-age=0, private, must-revalidate, no-transform
|
|||
Vary: Origin
|
||||
X-Content-Type-Options: nosniff
|
||||
|
||||
{"id":16268,"owner":{"id":3,"login":"gitea","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/avatars/35dea380390772b3130aafbac7ca49e6","html_url":"https://gitea.com/gitea","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-11-29T03:16:17Z","restricted":false,"active":false,"prohibit_login":false,"location":"Git Universe","website":"https://about.gitea.com","description":"Git with a cup of tea","visibility":"public","followers_count":53,"following_count":0,"starred_repos_count":0,"username":"gitea"},"name":"test_repo","full_name":"gitea/test_repo","description":"Test repository for testing migration from gitea to gitea","empty":false,"private":false,"fork":false,"template":false,"parent":null,"mirror":false,"size":68,"language":"","languages_url":"https://gitea.com/api/v1/repos/gitea/test_repo/languages","html_url":"https://gitea.com/gitea/test_repo","url":"https://gitea.com/api/v1/repos/gitea/test_repo","link":"","ssh_url":"git@gitea.com:gitea/test_repo.git","clone_url":"https://gitea.com/gitea/test_repo.git","original_url":"","website":"","stars_count":1,"forks_count":2,"watchers_count":9,"open_issues_count":2,"open_pr_counter":2,"release_counter":2,"default_branch":"master","archived":false,"created_at":"2020-09-01T00:12:27Z","updated_at":"2020-09-01T18:03:41Z","archived_at":"1970-01-01T00:00:00Z","permissions":{"admin":false,"push":false,"pull":true},"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"","has_releases":true,"has_packages":false,"has_actions":false,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":false,"allow_rebase_update":true,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","repo_transfer":null,"topics":["gitea","test","migration","ci"],"licenses":null}
|
||||
{"id":16268,"owner":{"id":3,"login":"gitea","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/avatars/35dea380390772b3130aafbac7ca49e6","html_url":"https://gitea.com/gitea","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-11-29T03:16:17Z","restricted":false,"active":false,"prohibit_login":false,"location":"Git Universe","website":"https://codeberg.org/forgejo/forgejo/","description":"Git with a cup of tea","visibility":"public","followers_count":53,"following_count":0,"starred_repos_count":0,"username":"gitea"},"name":"test_repo","full_name":"gitea/test_repo","description":"Test repository for testing migration from gitea to gitea","empty":false,"private":false,"fork":false,"template":false,"parent":null,"mirror":false,"size":68,"language":"","languages_url":"https://gitea.com/api/v1/repos/gitea/test_repo/languages","html_url":"https://gitea.com/gitea/test_repo","url":"https://gitea.com/api/v1/repos/gitea/test_repo","link":"","ssh_url":"git@gitea.com:gitea/test_repo.git","clone_url":"https://gitea.com/gitea/test_repo.git","original_url":"","website":"https://codeberg.org/forgejo/forgejo/","stars_count":1,"forks_count":2,"watchers_count":9,"open_issues_count":2,"open_pr_counter":2,"release_counter":2,"default_branch":"master","archived":false,"created_at":"2020-09-01T00:12:27Z","updated_at":"2020-09-01T18:03:41Z","archived_at":"1970-01-01T00:00:00Z","permissions":{"admin":false,"push":false,"pull":true},"has_issues":true,"internal_tracker":{"enable_time_tracker":true,"allow_only_contributors_to_track_time":true,"enable_issue_dependencies":true},"has_wiki":true,"has_pull_requests":true,"has_projects":true,"projects_mode":"","has_releases":true,"has_packages":false,"has_actions":false,"ignore_whitespace_conflicts":false,"allow_merge_commits":true,"allow_rebase":true,"allow_rebase_explicit":true,"allow_squash_merge":true,"allow_fast_forward_only_merge":false,"allow_rebase_update":true,"default_delete_branch_after_merge":false,"default_merge_style":"merge","default_allow_maintainer_edit":false,"avatar_url":"","internal":false,"mirror_interval":"","object_format_name":"sha1","mirror_updated":"0001-01-01T00:00:00Z","repo_transfer":null,"topics":["gitea","test","migration","ci"],"licenses":null}
|
||||
|
|
|
@ -7,4 +7,4 @@ X-Frame-Options: SAMEORIGIN
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 1293
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T00:15:14Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"confused","created_at":"2020-09-01T00:15:19Z"}]
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T00:15:14Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"confused","created_at":"2020-09-01T00:15:19Z"}]
|
||||
|
|
|
@ -7,4 +7,4 @@ Content-Length: 1824
|
|||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
Vary: Origin
|
||||
|
||||
[{"id":116550,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116550","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"body":"a really good question!\n\nIt is the used as TESTSET for gitea2gitea repo migration function","assets":[],"created_at":"2020-09-01T15:49:30Z","updated_at":"2020-09-02T18:21:05Z"},{"id":116552,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116552","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"ghost@noreply.gitea.com","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"body":"Oh!","assets":[],"created_at":"2020-09-01T15:49:53Z","updated_at":"2020-09-01T15:49:53Z"}]
|
||||
[{"id":116550,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116550","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"body":"a really good question!\n\nIt is the used as TESTSET for gitea2gitea repo migration function","assets":[],"created_at":"2020-09-01T15:49:30Z","updated_at":"2020-09-02T18:21:05Z"},{"id":116552,"html_url":"https://gitea.com/gitea/test_repo/issues/4#issuecomment-116552","pull_request_url":"","issue_url":"https://gitea.com/gitea/test_repo/issues/4","user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"ghost@noreply.gitea.com","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://codeberg.org/forgejo/forgejo/","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"body":"Oh!","assets":[],"created_at":"2020-09-01T15:49:53Z","updated_at":"2020-09-01T15:49:53Z"}]
|
||||
|
|
|
@ -7,4 +7,4 @@ X-Content-Type-Options: nosniff
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 1290
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T19:36:40Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"laugh","created_at":"2020-09-01T19:36:45Z"}]
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"gitea","created_at":"2020-09-01T19:36:40Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"laugh","created_at":"2020-09-01T19:36:45Z"}]
|
||||
|
|
|
@ -7,4 +7,4 @@ Content-Type: application/json;charset=utf-8
|
|||
Cache-Control: max-age=0, private, must-revalidate, no-transform
|
||||
X-Total-Count: 2
|
||||
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"+1","created_at":"2020-09-01T16:07:06Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"hooray","created_at":"2020-09-01T16:07:11Z"}]
|
||||
[{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"+1","created_at":"2020-09-01T16:07:06Z"},{"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"content":"hooray","created_at":"2020-09-01T16:07:11Z"}]
|
||||
|
|
|
@ -7,4 +7,4 @@ X-Total-Count: 7
|
|||
Content-Type: application/json;charset=utf-8
|
||||
Vary: Origin
|
||||
|
||||
[{"id":30475,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/4","html_url":"https://gitea.com/gitea/test_repo/issues/4","number":4,"user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"title":"what is this repo about?","body":"","ref":"","assets":[],"labels":[{"id":3733,"name":"Question","exclusive":false,"is_archived":false,"color":"fbca04","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3733"}],"milestone":{"id":1300,"title":"V1","description":"Generate Content","state":"closed","open_issues":0,"closed_issues":4,"created_at":"1970-01-01T00:00:00Z","updated_at":"1970-01-01T00:00:00Z","closed_at":"2020-09-01T18:36:46Z","due_on":null},"assignee":null,"assignees":null,"state":"closed","is_locked":true,"comments":2,"created_at":"2020-09-01T15:48:41Z","updated_at":"2020-09-01T15:50:00Z","closed_at":"2020-09-01T15:49:34Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0},{"id":30471,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/2","html_url":"https://gitea.com/gitea/test_repo/issues/2","number":2,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"title":"Spam","body":":(","ref":"","assets":[],"labels":[{"id":3732,"name":"Invalid","exclusive":false,"is_archived":false,"color":"d4c5f9","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3732"}],"milestone":null,"assignee":null,"assignees":null,"state":"closed","is_locked":false,"comments":2,"created_at":"2020-09-01T00:23:00Z","updated_at":"2020-09-01T14:11:37Z","closed_at":"2020-09-01T14:11:37Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0}]
|
||||
[{"id":30475,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/4","html_url":"https://gitea.com/gitea/test_repo/issues/4","number":4,"user":{"id":-1,"login":"Ghost","login_name":"","source_id":0,"full_name":"","email":"","avatar_url":"https://gitea.com/assets/img/avatar_default.png","html_url":"https://gitea.com/Ghost","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"1970-01-01T00:00:00Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://codeberg.org/forgejo/forgejo/","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"Ghost"},"original_author":"","original_author_id":0,"title":"what is this repo about?","body":"","ref":"","assets":[],"labels":[{"id":3733,"name":"Question","exclusive":false,"is_archived":false,"color":"fbca04","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3733"}],"milestone":{"id":1300,"title":"V1","description":"Generate Content","state":"closed","open_issues":0,"closed_issues":4,"created_at":"1970-01-01T00:00:00Z","updated_at":"1970-01-01T00:00:00Z","closed_at":"2020-09-01T18:36:46Z","due_on":null},"assignee":null,"assignees":null,"state":"closed","is_locked":true,"comments":2,"created_at":"2020-09-01T15:48:41Z","updated_at":"2020-09-01T15:50:00Z","closed_at":"2020-09-01T15:49:34Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0},{"id":30471,"url":"https://gitea.com/api/v1/repos/gitea/test_repo/issues/2","html_url":"https://gitea.com/gitea/test_repo/issues/2","number":2,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"original_author":"","original_author_id":0,"title":"Spam","body":":(","ref":"","assets":[],"labels":[{"id":3732,"name":"Invalid","exclusive":false,"is_archived":false,"color":"d4c5f9","description":"","url":"https://gitea.com/api/v1/repos/gitea/test_repo/labels/3732"}],"milestone":null,"assignee":null,"assignees":null,"state":"closed","is_locked":false,"comments":2,"created_at":"2020-09-01T00:23:00Z","updated_at":"2020-09-01T14:11:37Z","closed_at":"2020-09-01T14:11:37Z","due_date":null,"pull_request":null,"repository":{"id":16268,"name":"test_repo","owner":"gitea","full_name":"gitea/test_repo"},"pin_order":0}]
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,4 +5,4 @@ Vary: Origin
|
|||
X-Content-Type-Options: nosniff
|
||||
X-Frame-Options: SAMEORIGIN
|
||||
|
||||
[{"id":116561,"body":"is one `\\newline` to less?","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"resolver":null,"pull_request_review_id":1770,"created_at":"2020-09-01T16:12:58Z","updated_at":"2024-06-03T01:18:36Z","path":"README.md","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","original_commit_id":"","diff_hunk":"@@ -2,3 +2,3 @@\n \n-Test repository for testing migration from gitea 2 gitea\n\\ No newline at end of file\n+Test repository for testing migration from gitea 2 gitea","position":4,"original_position":0,"html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116561","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
||||
[{"id":116561,"body":"is one `\\newline` to less?","user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"resolver":null,"pull_request_review_id":1770,"created_at":"2020-09-01T16:12:58Z","updated_at":"2024-06-03T01:18:36Z","path":"README.md","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","original_commit_id":"","diff_hunk":"@@ -2,3 +2,3 @@\n \n-Test repository for testing migration from gitea 2 gitea\n\\ No newline at end of file\n+Test repository for testing migration from gitea 2 gitea","position":4,"original_position":0,"html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116561","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
||||
|
|
|
@ -6,4 +6,4 @@ Vary: Origin
|
|||
X-Frame-Options: SAMEORIGIN
|
||||
X-Total-Count: 3
|
||||
|
||||
[{"id":1770,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"team":null,"state":"COMMENT","body":"","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":1,"submitted_at":"2020-09-01T16:12:58Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116562","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1771,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://techknowlogick.com","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"REQUEST_CHANGES","body":"I think this needs some changes","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:06:47Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116563","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1772,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://techknowlogick.com","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"APPROVED","body":"looks good","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":true,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:19:51Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116564","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
||||
[{"id":1770,"user":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@obermui.de","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"team":null,"state":"COMMENT","body":"","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":1,"submitted_at":"2020-09-01T16:12:58Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116562","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1771,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://codeberg.org/forgejo/forgejo/","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"REQUEST_CHANGES","body":"I think this needs some changes","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":false,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:06:47Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116563","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"},{"id":1772,"user":{"id":9,"login":"techknowlogick","login_name":"","source_id":0,"full_name":"","email":"techknowlogick@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/9b588dd0b384d6f6ae841c5d62302033","html_url":"https://gitea.com/techknowlogick","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-01-14T06:48:35Z","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"https://codeberg.org/forgejo/forgejo/","description":"","visibility":"public","followers_count":11,"following_count":1,"starred_repos_count":4,"username":"techknowlogick"},"team":null,"state":"APPROVED","body":"looks good","commit_id":"187ece0cb6631e2858a6872e5733433bb3ca3b03","stale":false,"official":true,"dismissed":true,"comments_count":0,"submitted_at":"2020-09-01T17:19:51Z","updated_at":"2021-04-18T22:00:49Z","html_url":"https://gitea.com/gitea/test_repo/pulls/7#issuecomment-116564","pull_request_url":"https://gitea.com/gitea/test_repo/pulls/7"}]
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -6,4 +6,4 @@ Cache-Control: max-age=0, private, must-revalidate, no-transform
|
|||
X-Content-Type-Options: nosniff
|
||||
X-Total-Count: 2
|
||||
|
||||
[{"id":167250,"tag_name":"v2-rc1","target_commitish":"master","name":"Second Release","body":"this repo has:\r\n* reactions\r\n* wiki\r\n* issues (open/closed)\r\n* pulls (open/closed/merged) (external/internal)\r\n* pull reviews\r\n* projects\r\n* milestones\r\n* labels\r\n* releases\r\n\r\nto test migration against","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250","html_url":"https://gitea.com/gitea/test_repo/releases/tag/v2-rc1","tarball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250/assets","draft":false,"prerelease":true,"created_at":"2020-09-01T18:02:43Z","published_at":"2020-09-01T18:02:43Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]},{"id":167249,"tag_name":"V1","target_commitish":"master","name":"First Release","body":"as title","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249","html_url":"https://gitea.com/gitea/test_repo/releases/tag/V1","tarball_url":"https://gitea.com/gitea/test_repo/archive/V1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/V1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249/assets","draft":false,"prerelease":false,"created_at":"2020-09-01T17:30:32Z","published_at":"2020-09-01T17:30:32Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://mh.obermui.de","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]}]
|
||||
[{"id":167250,"tag_name":"v2-rc1","target_commitish":"master","name":"Second Release","body":"this repo has:\r\n* reactions\r\n* wiki\r\n* issues (open/closed)\r\n* pulls (open/closed/merged) (external/internal)\r\n* pull reviews\r\n* projects\r\n* milestones\r\n* labels\r\n* releases\r\n\r\nto test migration against","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250","html_url":"https://gitea.com/gitea/test_repo/releases/tag/v2-rc1","tarball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/v2-rc1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167250/assets","draft":false,"prerelease":true,"created_at":"2020-09-01T18:02:43Z","published_at":"2020-09-01T18:02:43Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]},{"id":167249,"tag_name":"V1","target_commitish":"master","name":"First Release","body":"as title","url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249","html_url":"https://gitea.com/gitea/test_repo/releases/tag/V1","tarball_url":"https://gitea.com/gitea/test_repo/archive/V1.tar.gz","zipball_url":"https://gitea.com/gitea/test_repo/archive/V1.zip","upload_url":"https://gitea.com/api/v1/repos/gitea/test_repo/releases/167249/assets","draft":false,"prerelease":false,"created_at":"2020-09-01T17:30:32Z","published_at":"2020-09-01T17:30:32Z","author":{"id":689,"login":"6543","login_name":"","source_id":0,"full_name":"","email":"6543@noreply.gitea.com","avatar_url":"https://gitea.com/avatars/aeb6c290f1988daefa7421c5409e80dc","html_url":"https://gitea.com/6543","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2019-07-17T21:08:41Z","restricted":false,"active":false,"prohibit_login":false,"location":"Germany","website":"https://codeberg.org/forgejo/forgejo/","description":"gitea instance: https://code.obermui.de","visibility":"public","followers_count":10,"following_count":7,"starred_repos_count":18,"username":"6543"},"assets":[]}]
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -45,6 +45,7 @@ type CreateRepoOptions struct {
|
|||
TrustModel repo_model.TrustModelType
|
||||
MirrorInterval string
|
||||
ObjectFormatName string
|
||||
Website string
|
||||
}
|
||||
|
||||
func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir, repoPath string, opts CreateRepoOptions) error {
|
||||
|
@ -238,6 +239,7 @@ func CreateRepositoryDirectly(ctx context.Context, doer, u *user_model.User, opt
|
|||
DefaultBranch: opts.DefaultBranch,
|
||||
WikiBranch: setting.Repository.DefaultBranch,
|
||||
ObjectFormatName: opts.ObjectFormatName,
|
||||
Website: opts.Website,
|
||||
}
|
||||
|
||||
var rollbackRepo *repo_model.Repository
|
||||
|
|
|
@ -109,7 +109,7 @@ test('markdown indentation', async ({page}) => {
|
|||
});
|
||||
|
||||
test('markdown list continuation', async ({page}) => {
|
||||
const initText = `* first\n* second\n* third\n* last`;
|
||||
const initText = `* first\n* second`;
|
||||
|
||||
const response = await page.goto('/user2/repo1/issues/new');
|
||||
expect(response?.status()).toBe(200);
|
||||
|
@ -120,24 +120,19 @@ test('markdown list continuation', async ({page}) => {
|
|||
await textarea.fill(initText);
|
||||
|
||||
// Test continuation of ' * ' prefix
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.indexOf('cond'), it.value.indexOf('cond')));
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.indexOf('rst'), it.value.indexOf('rst')));
|
||||
await indent.click();
|
||||
await textarea.press('End');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('middle');
|
||||
await expect(textarea).toHaveValue(`* first\n* second\n* middle\n* third\n* last`);
|
||||
|
||||
// Test continuation of ' * ' prefix
|
||||
await indent.click();
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('muddle');
|
||||
await expect(textarea).toHaveValue(`* first\n* second\n${tab}* middle\n${tab}* muddle\n* third\n* last`);
|
||||
await expect(textarea).toHaveValue(`${tab}* first\n${tab}* muddle\n* second`);
|
||||
|
||||
// Test breaking in the middle of a line
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.lastIndexOf('ddle'), it.value.lastIndexOf('ddle')));
|
||||
await textarea.pressSequentially('tate');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('me');
|
||||
await expect(textarea).toHaveValue(`* first\n* second\n${tab}* middle\n${tab}* mutate\n${tab}* meddle\n* third\n* last`);
|
||||
await expect(textarea).toHaveValue(`${tab}* first\n${tab}* mutate\n${tab}* meddle\n* second`);
|
||||
|
||||
// Test not triggering when Shift held
|
||||
await textarea.fill(initText);
|
||||
|
@ -145,28 +140,29 @@ test('markdown list continuation', async ({page}) => {
|
|||
await textarea.press('Shift+Enter');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('...but not least');
|
||||
await expect(textarea).toHaveValue(`* first\n* second\n* third\n* last\n\n...but not least`);
|
||||
await expect(textarea).toHaveValue(`* first\n* second\n\n...but not least`);
|
||||
|
||||
// Test continuation of ordered list
|
||||
await textarea.fill(`1. one\n2. two`);
|
||||
await textarea.fill(`1. one`);
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.length, it.value.length));
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially(' ');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('three');
|
||||
await expect(textarea).toHaveValue(`1. one\n2. two\n3. three`);
|
||||
await textarea.press('Enter');
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`1. one\n2. \n3. three\n\n`);
|
||||
|
||||
// Test continuation of alternative ordered list syntax
|
||||
await textarea.fill(`1) one\n2) two`);
|
||||
await textarea.fill(`1) one`);
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.length, it.value.length));
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially(' ');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('three');
|
||||
await expect(textarea).toHaveValue(`1) one\n2) two\n3) three`);
|
||||
|
||||
// Test continuation of blockquote
|
||||
await textarea.fill(`> knowledge is power`);
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.length, it.value.length));
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('france is bacon');
|
||||
await expect(textarea).toHaveValue(`> knowledge is power\n> france is bacon`);
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`1) one\n2) \n3) three\n\n`);
|
||||
|
||||
// Test continuation of checklists
|
||||
await textarea.fill(`- [ ]have a problem\n- [x]create a solution`);
|
||||
|
@ -189,7 +185,6 @@ test('markdown list continuation', async ({page}) => {
|
|||
'> ',
|
||||
'> > ',
|
||||
'- [ ] ',
|
||||
'- [ ]', // This does seem to render, so allow.
|
||||
'* [ ] ',
|
||||
'+ [ ] ',
|
||||
];
|
||||
|
@ -197,8 +192,12 @@ test('markdown list continuation', async ({page}) => {
|
|||
await textarea.fill(`${prefix}one`);
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.length, it.value.length));
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially(' ');
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('two');
|
||||
await expect(textarea).toHaveValue(`${prefix}one\n${prefix}two`);
|
||||
await textarea.press('Enter');
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`${prefix}one\n${prefix} \n${prefix}two\n\n`);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -224,3 +223,29 @@ test('markdown insert table', async ({page}) => {
|
|||
await expect(textarea).toHaveValue('| Header | Header |\n|---------|---------|\n| Content | Content |\n| Content | Content |\n| Content | Content |\n');
|
||||
await save_visual(page);
|
||||
});
|
||||
|
||||
test('text expander has higher prio then prefix continuation', async ({page}) => {
|
||||
const response = await page.goto('/user2/repo1/issues/new');
|
||||
expect(response?.status()).toBe(200);
|
||||
|
||||
const textarea = page.locator('textarea[name=content]');
|
||||
const initText = `* first`;
|
||||
await textarea.fill(initText);
|
||||
await textarea.evaluate((it:HTMLTextAreaElement) => it.setSelectionRange(it.value.indexOf('rst'), it.value.indexOf('rst')));
|
||||
await textarea.press('End');
|
||||
|
||||
// Test emoji completion
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially(':smile_c');
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`* first\n* 😸`);
|
||||
|
||||
// Test username completion
|
||||
await textarea.press('Enter');
|
||||
await textarea.pressSequentially('@user');
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`* first\n* 😸\n* @user2 `);
|
||||
|
||||
await textarea.press('Enter');
|
||||
await expect(textarea).toHaveValue(`* first\n* 😸\n* @user2 \n* `);
|
||||
});
|
||||
|
|
|
@ -8,10 +8,27 @@ import {expect} from '@playwright/test';
|
|||
import {save_visual, test} from './utils_e2e.ts';
|
||||
|
||||
test('Commit graph overflow', async ({page}) => {
|
||||
await page.goto('/user2/diff-test/graph');
|
||||
const response = await page.goto('/user2/repo1/graph');
|
||||
expect(response?.status()).toBe(200);
|
||||
|
||||
await page.click('#flow-select-refs-dropdown');
|
||||
const input = page.locator('#flow-select-refs-dropdown');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
await input.press('Enter');
|
||||
|
||||
await expect(page.locator('#flow-select-refs-dropdown')).toBeInViewport({ratio: 1});
|
||||
await expect(page.getByRole('button', {name: 'Mono'})).toBeInViewport({ratio: 1});
|
||||
await expect(page.getByRole('button', {name: 'Color'})).toBeInViewport({ratio: 1});
|
||||
await expect(page.locator('.selection.search.dropdown')).toBeInViewport({ratio: 1});
|
||||
await save_visual(page);
|
||||
});
|
||||
|
||||
test('Switch branch', async ({page}) => {
|
||||
|
|
|
@ -23,6 +23,18 @@
|
|||
#git-graph-heading {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#git-graph-heading-left {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
#git-graph-heading h2 {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#git-graph-container #flow-select-refs-dropdown {
|
||||
min-width: 250px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
|
@ -34,15 +46,10 @@
|
|||
#git-graph-heading-left {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
h2,
|
||||
#flow-select-refs-dropdown {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#git-graph-container #flow-select-refs-dropdown {
|
||||
min-width: 250px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#git-graph-container #flow-select-refs-dropdown .ui.label {
|
||||
|
|
|
@ -99,6 +99,8 @@ class ComboMarkdownEditor {
|
|||
e.target._shiftDown = true;
|
||||
}
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.altKey) {
|
||||
// Prevent special line break handling if currently a text expander popup is open
|
||||
if (this.textarea.hasAttribute('aria-expanded')) return;
|
||||
if (!this.breakLine()) return; // Nothing changed, let the default handler work.
|
||||
this.options?.onContentChanged?.(this, e);
|
||||
e.preventDefault();
|
||||
|
@ -407,13 +409,27 @@ class ComboMarkdownEditor {
|
|||
// Find the beginning of the current line.
|
||||
const lineStart = Math.max(0, value.lastIndexOf('\n', start - 1) + 1);
|
||||
// Find the end and extract the line.
|
||||
const lineEnd = value.indexOf('\n', start);
|
||||
const line = value.slice(lineStart, lineEnd === -1 ? value.length : lineEnd);
|
||||
const nextLF = value.indexOf('\n', start);
|
||||
const lineEnd = nextLF === -1 ? value.length : nextLF;
|
||||
const line = value.slice(lineStart, lineEnd);
|
||||
// Match any whitespace at the start + any repeatable prefix + exactly one space after.
|
||||
const prefix = line.match(/^\s*((\d+)[.)]\s|[-*+]\s+(\[[ x]\]\s?)?|(>\s+)+)?/);
|
||||
const prefix = line.match(/^\s*((\d+)[.)]\s|[-*+]\s{1,4}\[[ x]\]\s?|[-*+]\s|(>\s?)+)?/);
|
||||
|
||||
// Defer to browser if we can't do anything more useful, or if the cursor is inside the prefix.
|
||||
if (!prefix || !prefix[0].length || lineStart + prefix[0].length > start) return false;
|
||||
if (!prefix) return false;
|
||||
const prefixLength = prefix[0].length;
|
||||
if (!prefixLength || lineStart + prefixLength > start) return false;
|
||||
// If the prefix is just indentation (which should always be an even number of spaces or tabs), check if a single whitespace is added to the end of the line.
|
||||
// If this is the case do not leave the indentation and continue with the prefix.
|
||||
if ((prefixLength % 2 === 1 && /^ +$/.test(prefix[0])) || /^\t+ $/.test(prefix[0])) {
|
||||
prefix[0] = prefix[0].slice(0, prefixLength - 1);
|
||||
} else if (prefixLength === lineEnd - lineStart) {
|
||||
this.textarea.setSelectionRange(lineStart, lineEnd);
|
||||
if (!document.execCommand('insertText', false, '\n')) {
|
||||
this.textarea.setRangeText('\n');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Insert newline + prefix.
|
||||
let text = `\n${prefix[0]}`;
|
||||
|
|
Loading…
Add table
Reference in a new issue