1
0
Fork 0
gitea/models
singuliere 8bd89ca294
preserve users if restoring a repository on the same Gitea instance (#18604)
When calling DumpRepository and RestoreRepository on the same Gitea
instance, the users are preserved: all labels, issues etc. belong to
the external user who is, in this particular case, the local user.

Dead code verifying g.gitServiceType.Name() == "" (i.e. plain git) is
removed. The function is never called because the plain git downloader
does not migrate anything that is associated to a user, by definition.

Errors returned by GetUserIDByExternalUserID are no longer ignored.

The userMap is used when the external user is not kown, which is the
most common case. It was only used when the external user exists
which happens less often and, as a result, every occurence of an
unknown external user required a SQL query.

Signed-off-by: Loïc Dachary <loic@dachary.org>

Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-02-06 17:05:29 +08:00
..
admin
appstate
asymkey Collaborator trust model should trust collaborators (#18539) 2022-02-02 11:10:06 +01:00
auth Use `CryptoRandomBytes` instead of `CryptoRandomString` (#18439) 2022-02-04 18:03:15 +01:00
avatars
db
fixtures add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
issues
migrations
perm
repo
unit
unittest
user preserve users if restoring a repository on the same Gitea instance (#18604) 2022-02-06 17:05:29 +08:00
webhook
access.go
access_test.go
action.go
action_list.go
action_test.go
branches.go
branches_test.go
commit.go Collaborator trust model should trust collaborators (#18539) 2022-02-02 11:10:06 +01:00
commit_status.go
commit_status_test.go
consistency.go
consistency_test.go
engine_test.go
error.go
fixture_generation.go
fixture_test.go
helper.go
helper_directory.go
helper_environment.go
issue.go add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
issue_assignees.go
issue_assignees_test.go
issue_comment.go add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
issue_comment_list.go
issue_comment_test.go
issue_dependency.go
issue_dependency_test.go
issue_label.go
issue_label_test.go
issue_list.go
issue_list_test.go
issue_lock.go
issue_milestone.go
issue_milestone_test.go
issue_reaction.go add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
issue_reaction_test.go
issue_stopwatch.go
issue_stopwatch_test.go
issue_test.go
issue_tracked_time.go
issue_tracked_time_test.go
issue_user.go
issue_user_test.go
issue_watch.go
issue_watch_test.go
issue_xref.go
issue_xref_test.go
lfs.go
lfs_lock.go
main_test.go
migrate.go
migrate_test.go
notification.go
notification_test.go
org.go
org_team.go Add `GetUserTeams` (#18499) 2022-02-01 14:09:24 -05:00
org_team_test.go Add `GetUserTeams` (#18499) 2022-02-01 14:09:24 -05:00
org_test.go
project.go
project_board.go
project_issue.go
project_test.go
protected_tag.go
protected_tag_test.go
pull.go
pull_list.go
pull_test.go
release.go add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
repo.go
repo_activity.go
repo_collaboration.go
repo_collaboration_test.go
repo_generate.go
repo_generate_test.go
repo_list.go
repo_list_test.go
repo_permission.go
repo_permission_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go
review.go add test coverage for original author conversion during migrations (#18506) 2022-02-01 13:20:28 -05:00
review_test.go
statistic.go
task.go
token.go
token_test.go
upload.go
user.go
user_heatmap.go
user_heatmap_test.go
user_test.go
userlist.go
userlist_test.go